Static functions
static loadFromAtlasRegion (region : AtlasRegion, tileWidth : Int, tileHeight : Int, tileMarginWidth : Int = 0, tileMarginHeight : Int = 0) : TileAtlas
Loads a TileAtlas from a region in another atlas.
* @param region An AtlasRegion object to pull tiles from
* @param tileWidth Width of the tiles
* @param tileHeight Height of the tiles
* @param tileMarginWidth Horizontal margin of the tiles
* @param tileMarginHeight Vertical margin of the tiles
* @return A TileAtlas with all packed images defined as regions ordered like a normal tileset.
static loadFromTextureAtlas (textureAtlas : TextureAtlas, regions : Array<String>) : TileAtlas
Loads a TileAtlas from a named TextureAtlas
Parameters:
| textureAtlas | A TextureAtlas object to pull frames from | |
| regions | A list of atlas region names in the order they should be in TileAtlas |
Returns:
A TileAtlas with all packed images defined as regions ordered by sprite names supplied
Constructor
new (source : AtlasDataType, tileWidth : Int, tileHeight : Int, tileMarginWidth : Int = 0, tileMarginHeight : Int = 0) : Void
Constructor.
Parameters:
| source | Source texture. | |
| tileWidth | Width of the tiles. | |
| tileHeight | Height of the tiles. | |
| tileMarginWidth | Horizontal margin of the tiles. | |
| tileMarginHeight | Vertical margin of the tiles. |
Variables
Functions
getRegion (index : Int) : AtlasRegion
Gets an atlas region based on an identifier
Parameters:
| index | The tile index of the region to retrieve |
Returns:
The atlas region object.
prepare (tileWidth : Int, tileHeight : Int, tileMarginWidth : Int = 0, tileMarginHeight : Int = 0, tileOffsetX : Int = 0, tileOffsetY : Int = 0) : Void
Prepares the atlas for drawing.
Parameters:
| tileWidth | With of the tiles. | |
| tileHeight | Height of the tiles. | |
| tileMarginWidth | Tile horizontal margin. | |
| tileMarginHeight | Tile vertical margin. |
assets