Creates a new Texture Factory.
Used to delimit properties of a texture rectangle
Separator used to delimit properties of a dynamic texture rectangle
Retrieves a texture by name, where the name can be either a base name of a texture or one with the additional properties,
as generated by getTextureRectangle()
or getTile()
.
If a name with properties is passed and that texture was not previously generated in this factory it'll work exactly the same
as if calling getTextureRectangle()
with the basename and rectangle extracted.
Name of the texture to retrieve
The texture for the name
Given a texture previously extracted from this factory returns its name. Most useful to get the generated name
of textures from getTile()
or getTextureRectangle()
.
Texture which name to get
Name of the texture
Retrieves a rectangle from a previously registered texture or a valid texture rectangle. If the name provided is a texture rectangle, the position provided will be relative to that rectangle's frame, not the base texture's frame.
Name of the texture to use as a basis
Offset X position from the top-left corner of the texture's frame
Offset Y position from the top-left corner of the texture's frame
Width of the new texture
Height of the new texture
The new texture that matches the specified frame.
Retrieves a texture that matches a tile at the given position in the tileset.
Name of the tileset to use.
X position of the tile
Y position of the tile
The texture for the requested tile
Registers a texture for use in the factory.
Texture to register
Name of the texture to use for access
Registers a previously registered texture as a tileset, to allow using it with getTile()
method. The texture can still be used
the same way it was used previously.
Name of the texture to use as the basis for the tileset
Tileset configuration
Generated using TypeDoc
Provides simple API for retrieving texture by name, by a segment of a texture or by a tile in a tileset.
The goal is to have a centralized source of textures that can be easily accessed just by a string. Simplifies serialization among other things.
To use this, a texture first has to be registered with a name, then you can access it by one of the many ways. A tileset can also be registered in which case its tiles can be retrieved via
getTile()
.Note:
TextureStore
never creates new BaseTextures. What it means is that for the purpose of performance, all the textures created from the same base texture are still part of that base texture, part of the same texture atlas.