Atlas frames collection. It makes possible to use texture atlases in Flixel. Plus it contains few packer parser methods for most commonly used atlas formats.
Static methods
staticfindFrame(graphic:FlxGraphic, ?border:FlxPoint):FlxAtlasFrames
Returns the FlxAtlasFrame
of the specified FlxGraphic
object.
Parameters:
graphic |
|
---|
Returns:
FlxAtlasFrames
collection for the specified FlxGraphic
object
Could be null
if FlxGraphic
doesn't have it yet.
staticinlinefromAseprite(source:FlxGraphicAsset, description:FlxAsepriteJsonAsset):FlxAtlasFrames
Parsing method for atlases generated from Aseprite's JSON export options. Note that Aseprite
and Texture Packer use the same JSON format, however this method honors frames' duration
whereas fromTexturePackerJson
ignores it by default (for backwrds compatibility reasons).
Parameters:
source | The image source (can be |
---|---|
description | Contents of JSON file with atlas description.
You can get it with |
Returns:
Newly created FlxAtlasFrames
collection.
See also:
staticfromLibGdx(source:FlxGraphicAsset, description:String):FlxAtlasFrames
Parsing method for LibGDX atlases.
Parameters:
source | The image source (can be |
---|---|
description | Contents of the file with atlas description.
You can get it with |
Returns:
Newly created FlxAtlasFrames
collection.
staticfromSparrow(source:FlxGraphicAsset, xml:FlxXmlAsset):FlxAtlasFrames
Parsing method for Sparrow texture atlases (they can be generated with Shoebox http://renderhjs.net/shoebox/ for example).
Parameters:
source | The image source (can be |
---|---|
xml | Contents of the XML file with atlas description.
Can be a path to the XML asset, an XML string, or an |
Returns:
Newly created FlxAtlasFrames
collection.
staticfromSpriteSheetPacker(Source:FlxGraphicAsset, Description:String):FlxAtlasFrames
Parsing method for Sprite Sheet Packer atlases (http://spritesheetpacker.codeplex.com/).
Parameters:
Source | The image source (can be |
---|---|
Description | Contents of the file with atlas description.
You can get it with |
Returns:
Newly created FlxAtlasFrames
collection.
staticfromTexturePackerJson(source:FlxGraphicAsset, description:FlxTexturePackerJsonAsset, useFrameDuration:Bool = false):FlxAtlasFrames
Parsing method for TexturePacker atlases in JSON format.
Parameters:
source | The image source (can be |
---|---|
description | Contents of JSON file with atlas description.
You can get it with |
useFrameDuration | If true, any frame durations defined in the JSON will override the
frameRate set in you |
Returns:
Newly created FlxAtlasFrames
collection.
staticfromTexturePackerXml(source:FlxGraphicAsset, xml:FlxXmlAsset):FlxAtlasFrames
Parsing method for TexturePacker atlases in generic XML format.
Parameters:
source | The image source (can be |
---|---|
xml | Contents of the XML file with atlas description.
Can be a path to the XML asset, an XML string, or an |
Returns:
Newly created FlxAtlasFrames
collection.
Constructor
Methods
addAtlas(collection:FlxAtlasFrames, overwriteHash:Bool = false):FlxAtlasFrames
Adds all ofthe frames from the specified collection
Parameters:
collection | The frames to add. Note: calling destroy() on this collection after it has been added can cause crashes. |
---|---|
overwriteHash | If true, any new frames with matching names will replace old ones. |
5.3.0
.concat(collection:FlxAtlasFrames, overwriteHash:Bool = false):FlxAtlasFrames
Creates a new FlxAtlasFrames
instance with all the frames from this and the desired instance.
Note: Calling destroy
on either of these graphics after concatenating them may cause crashes
Parameters:
collection | The other frames to add. |
---|---|
overwriteHash | If true, any new frames with matching names will replace old ones. |
5.3.0
.