Contains useful data of an image that is used by an nb.Atlas's instance.

Available since

0.1.0

.

Constructor

private@:dox(show)new(bytes:Bytes, format:PixelFormat, w:Int, h:Int, name:String, atlas:Atlas)

The private constructor. Accessible from an Atlas class.

Parameters:

bytes

Bytes of the associated image.

format

Pixel format of the associated image.

w

Width of the associated image.

h

Height of the associated image.

name

A name for this instance.

atlas

Atlas instance this instance was created from.

Variables

atlas:Atlas

The associated Atlas instance.

read onlybytes:Bytes

Original bytes of the associated image. Same as the bytes after conversion from an Atlas's addX function.

@:value(null)read onlyclonedFrom:SubData = null

SubData this instance was cloned from.

@:value(null)read onlyconvertedBytes:Bytes = null

The last converted bytes of the associated image needed by the last call of the make function of the Atlas.

Resets to null if the last call didn't need to convert bytes.

@:value(null)read onlyconvertedFormat:PixelFormat = null

Pixel format of convertedBytes.

@:value(0)read onlydx:Int = 0

X Offset of the associated image from the left border of the aseprite canvas.

@:value(0)read onlydy:Int = 0

Y Offset of the associated image from the left border of the aseprite canvas.

read onlyentry:FileEntry

FileEntry used to create this instance.

read onlyformat:PixelFormat

Pixel format of bytes.

@:value(0)read onlyframeId:Int = 0

ID of the frame in aseprite of the associated image.

@:value(-1)read onlyh:Int = -1

Height of the associated image in atlas's texture. Determined only after a texture is made from atlas.

@:value(0)read onlylayerId:Int = 0

ID of the layer in aseprite of the associated image.

@:value([])linked:Array<SubData> = []

read onlyname:String

The name of this instance.

@:value(-1)read onlyw:Int = -1

Width of the associated image in atlas's texture. Determined only after a texture is made from atlas.

@:value(-1)x:Int = -1

X position of the associated image in atlas's texture. Determined only after a texture is made from atlas.

@:value(-1)y:Int = -1

Y position of the associated image in atlas's texture. Determined only after a texture is made from atlas.

Methods

convertTo(toFormat:PixelFormat):Void

Sets convertedBytes with the value of bytes converted, or null if bytes doesn't need to be converted.

Parameters:

toFormat

The format to convert bytes to.

toString():String

Returns a string representation containing the name of this instance and the Atlas instance's area associated with it.