Atlas node holds information about image on Atlas. Plus it have few methods for easy frame data generation, which can be loaded in sprites and in tilemaps.

Constructor

@:value({ rotated : false, key : "", filled : false })new(rect:FlxRect, atlas:FlxAtlas, filled:Bool = false, key:String = "", rotated:Bool = false)

Node constructor

Parameters:

rect

Region of atlas this node holds.

atlas

Atlas this node belongs to.

filled

Whether this node contains image or not.

key

The name of image in this node, and the name of this node.

Variables

atlas:FlxAtlas

Atlas object which contains this node.

read onlyfilled:Bool

Logical flag showing whether this node has an image in it or not.

height:Int

The height of this node.

read onlyisEmpty:Bool

Logical flag, showing whether this node have any child nodes or image in it.

key:String

The "name" of this node. You can get access to this node with it: atlas.getNode(key);

left:FlxNode

Left child of this node.

rect:FlxRect

Region of the atlas which this node holds, includes spacings between nodes.

right:FlxNode

Right child of this node.

read onlyrotated:Bool

width:Int

The width of this node.

read onlyx:Int

The x coordinate of the top-left corner of this node.

read onlyy:Int

The y coordinate of the top-left corner of this node.

Methods

inlinecanPlace(width:Int, height:Int):Bool

Whether we place node with specified width and height in this node.

inlinedestroy():Void

getImageFrame():FlxImageFrame

Generates a FlxImageFrame object for this node.

Returns:

FlxImageFrame for the whole node

getTileFrames(tileSize:FlxPoint, ?tileSpacing:FlxPoint, ?tileBorder:FlxPoint):FlxTileFrames

Generates TileFrames object for this node

Parameters:

tileSize

The size of tile in spritesheet.

tileSpacing

Offsets between tiles in spritesheet.

tileBorder

Border to add around tiles (helps to avoid "tearing" problem).

Returns:

Created TileFrames object for this node.