class spinehx.atlas.AtlasRegion extends TextureRegion

import spinehx.atlas.TextureAtlas;

Available on all platforms

Describes the region of a packed image and provides information about the original image before it was packed.

Class Fields

static function copy(region:AtlasRegion):AtlasRegion

static function create(texture:Texture, x:Int, y:Int, width:Int, height:Int):AtlasRegion

Instance Fields

var index:Int

The number at the end of the original image file name, or -1 if none.
*
* When sprites are packed, if the original file name ends with a number, it is stored as the index and is not considered as * part of the sprite's name. This is useful for keeping animation frames in order. * @see TextureAtlas#findRegions(String)

var name:String

The name of the original image file, up to the first underscore. Underscores denote special instructions to the texture * packer.

var offsetX:Float

The offset from the left of the original image to the left of the packed image, after whitespace was removed for packing.

var offsetY:Float

The offset from the bottom of the original image to the bottom of the packed image, after whitespace was removed for * packing.

var originalHeight:Int

The height of the image, before whitespace was removed for packing.

var originalWidth:Int

The width of the image, before whitespace was removed and rotation was applied for packing.

var packedHeight:Int

The height of the image, after whitespace was removed for packing.

var packedWidth:Int

The width of the image, after whitespace was removed for packing.

var pads:Array<Int>

The ninepatch pads, or null if not a ninepatch or the has no padding. Has 4 elements: left, right, top, bottom.

var rotate:Bool

If true, the region has been rotated 90 degrees counter clockwise.

var splits:Array<Int>

The ninepatch splits, or null if not a ninepatch. Has 4 elements: left, right, top, bottom.

function new():Void

function flip(x:Bool, y:Bool):Void

Flips the region, adjusting the offset so the image appears to be flip as if no whitespace has been removed for packing.

function getRotatedPackedHeight():Float

Returns the packed height considering the rotate value, if it is true then it returns the packedWidth, otherwise it * returns the packedHeight.

function getRotatedPackedWidth():Float

Returns the packed width considering the rotate value, if it is true then it returns the packedHeight, otherwise it * returns the packedWidth.