class flixel.atlas.FlxAtlas

Available on all platforms

Atlas class * @author Zaphod

Instance Fields

var borderX:Int

Offsets between nodes in atlas

var height:Int

Total height of atlas

var root:FlxNode

Root node of atlas

var width:Int

Total width of atlas

function new(name:String, width:Int, height:Int, ?borderX:Int = 1, ?borderY:Int = 1):Void

Atlas constructor *

width

atlas width *

height

atlas height *

borderX

horizontal distance between nodes *

borderY

vertical distance between nodes

function addNode(Graphic:Dynamic, ?Key:String = null):FlxNode

Simply adds new node to atlas. *

data

image to store *

key

image name *

returns

added node

function addNodes(bitmaps:Array<BitmapData>, keys:Array<String>):Bool

Optimized version of method for adding multiple nodes to atlas. Uses less atlas' area *

bitmaps

BitmapData's to insert *

keys

Names of these bitmapData's *

returns

true if ALL nodes were added successfully.

function addToQueue(data:BitmapData, key:String):Void

Adds new object to queue for later creation of new node *

data

bitmapData to hold *

key

"name" of bitmapData

function clear():Void

Clears all data in atlas. Use it when you want reuse this atlas

function createQueue():Void

Creates new "queue" for adding new nodes

function destroy():Void

Destroys atlas. Use only if you want to clear memory and don't need this atlas anymore

function generateAtlasFromQueue():Void

Adds all objects in "queue" to existing atlas. Doesn't erase any node

function getNode(key:String):FlxNode

Gets node by it's name *

key

node name to search *

returns

node with searched name. Null if atlas doesn't contain node with a such name

function getRegionFor(nodeName:String):TextureRegion

Generates TextureRegion object for node with specified name *

nodeName

name of the node to generate TextureRegion object for *

returns

Generated TextureRegion

function getTextureData():TexturePackerData

Generates TexturePackerData object for this atlas. Where each frame represents one of the inserted images *

returns

TexturePackerData for this atlas

function hasNodeWithName(nodeName:String):Bool

Checks if atlas already contains node with the same name *

nodeName

node name to check *

returns

true if atlas already contains node with the name