Fork me on GitHub
View source

package haxepunk.graphics.atlas

class TextureAtlas


extends Atlas
extended by BitmapFontAtlas

Static functions

View source

static loadGdxTexturePacker (file : String) : TextureAtlas

Loads a libgdx TexturePacker file and generates all tile regions.


Parameters:
file   

The TexturePacker file to load


Returns:

A TextureAtlas with all packed images defined as regions

View source

static loadTexturePacker (file : String) : TextureAtlas

Loads a TexturePacker xml file and generates all tile regions. Uses the Generic XML exporter format from Texture Packer.


Parameters:
file   

The TexturePacker file to load


Returns:

A TextureAtlas with all packed images defined as regions

Functions

View source

defineRegion (name : String, rect : Rectangle, center : Vector2, page : String) : AtlasRegion

Creates a new AtlasRegion and assigns it to a name


Parameters:
name   

The region name to create

rect   

Defines the rectangle of the tile on the tilesheet

center   

Positions the local center point to pivot on

page   

(optional) Page name, if this atlas supports multiple pages


Returns:

The new AtlasRegion object.

View source

getRegion (name : String) : AtlasRegion

Gets an atlas region based on an identifier


Parameters:
name   

The name identifier of the region to retrieve.


Returns:

The retrieved region.