springroll.pixi.TextureAtlas Class

Handles a spritesheet. File extensions and folder paths are dropped from frame names upon loading.

Constructor

springroll.pixi.TextureAtlas

(
  • texture
  • data
  • [useGlobalCache]
)

Parameters:

  • texture PIXI.Texture

    The PIXI Texture that all sub-textures pull from.

  • data Object

    The JSON object describing the frames in the atlas. This is expected to fit the JSON Hash format as exported from TexturePacker.

  • [useGlobalCache] Boolean optional

    If sub-textures should be placed in Pixi's global texture cache.

Properties

destroy

()

Defined in destroy:194

Destroys the TextureAtlas by nulling the image and frame dictionary references.

getFrame

(
  • name
)
createjs.TextureAtlas.Texture

Defined in getFrame:105

Gets a frame by name.

Parameters:

  • name String

    The frame name to get.

Returns:

createjs.TextureAtlas.Texture:

The texture by that name, or null if it doesn't exist.

getFrames

(
  • name
  • numberMin
  • numberMax
  • [maxDigits=4]
  • [outArray]
)
Array

Defined in getFrames:117

Get an array of Textures that match a specific name. If a frame in a sequence is not in the atlas, the previous frame in the sequence is used in place of it.

Parameters:

  • name String

    The base name of all frames to look for, like "anim_#" to search for an animation exported as anim_0001.png (the ".png" is dropped when the TextureAtlas is loaded).

  • numberMin Int

    The number to start on while looking for frames. Flash PNG sequences generally start at 1.

  • numberMax Int

    The number to go until while looking for frames. If your animation runs from frame 0001 to frame 0014, numberMax would be 14.

  • [maxDigits=4] Int optional

    Maximum number of digits, like 4 for an animation exported as anim_0001.png

  • [outArray] Array optional

    If already using an array, this can fill it instead of creating a new one.

Returns:

Array:

The collection of createjs.TextureAtlas.Textures.

frames

Object

Defined in frames:30

The dictionary of Textures that this atlas consists of.