Murl Engine Lua Addon API  Version 1.0 beta
Murl.Resource.IAtlas

The IAtlas resource object interface.

An atlas resource contains a number of structures, each storing both a coordinate and a corresponding texture coordinate rectangle, which define the actual size of e.g. a plane on screen together with its corresponding sub-region of a texture. Note that there is no texture image actually stored within the atlas resource. When using the atlas for rendering, a corresponding Resource::IImage must be used for a separate texture to produce the correct output.


Table members

Methods


GetTextureSizeX()

Get the atlas' horizontal texture reference size, or 0 if undefined.

Integer GetTextureSizeX()

Returns
Integer The horizontal reference size.

GetTextureSizeY()

Get the atlas' vertical texture reference size, or 0 if undefined.

Integer GetTextureSizeY()

Returns
Integer The vertical reference size.

GetNumberOfRectangles()

Get the total number of rectangles stored in this resource.

Integer GetNumberOfRectangles()

Returns
Integer The number of rectangles.

GetRectangleIndex(rectangleName)

Get the index of a rectangle with a given name.

Integer GetRectangleIndex(String rectangleName)

Parameters
rectangleNameThe name of the rectangle to query.
Returns
Integer The zero-based index of the rectangle, or -1 if not found.

GetRectangleName(rectangleIndex)

Get the name of a rectangle at a given index.

String GetRectangleName(Integer rectangleIndex)

Parameters
rectangleIndexThe zero-based index of the rectangle, in the range from 0 to GetNumberOfRectangles()-1.
Returns
String The name of the rectangle, or null if the index was out of range.

GetRectangle(rectangleIndex)

Get the rectangle at a given index.

Murl.Resource.IRectangle GetRectangle(Integer rectangleIndex)

Parameters
rectangleIndexThe index in the range from 0 to GetNumberOfRectangles()-1.
Returns
Murl.Resource.IRectangle A pointer to the rectangle, or null if index is out of bounds.

GetExtendedRectangle(rectangleIndex)

Get the extended (i.e. uncropped) rectangle at a given index.

Murl.Resource.IRectangle GetExtendedRectangle(Integer rectangleIndex)

Parameters
rectangleIndexThe index in the range from 0 to GetNumberOfRectangles()-1.
Returns
Murl.Resource.IRectangle A pointer to the rectangle, or null if index is out of bounds.

GetCroppedRectangle(rectangleIndex)

Get the cropped rectangle at a given index.

Murl.Resource.IRectangle GetCroppedRectangle(Integer rectangleIndex)

Parameters
rectangleIndexThe index in the range from 0 to GetNumberOfRectangles()-1.
Returns
Murl.Resource.IRectangle A pointer to the rectangle, or null if index is out of bounds.

GetRectangleMaterialSlot(rectangleIndex)

Get the material slot of a rectangle at a given index.

Integer GetRectangleMaterialSlot(Integer rectangleIndex)

Parameters
rectangleIndexThe index in the range from 0 to GetNumberOfRectangles()-1.
Returns
Integer The slot, or -1 if not set or index is out of bounds.

GetRectangleParametersSlot(rectangleIndex)

Get the parameters slot of a rectangle at a given index.

Integer GetRectangleParametersSlot(Integer rectangleIndex)

Parameters
rectangleIndexThe index in the range from 0 to GetNumberOfRectangles()-1.
Returns
Integer The slot, or -1 if not set or index is out of bounds.

GetRectangleTextureSlot(rectangleIndex)

Get the texture slot of a rectangle at a given index.

Integer GetRectangleTextureSlot(Integer rectangleIndex)

Parameters
rectangleIndexThe index in the range from 0 to GetNumberOfRectangles()-1.
Returns
Integer The slot, or -1 if not set or index is out of bounds.

GetRectangleTextureSizeX(rectangleIndex)

Get the horizontal texture reference size for a given rectangle.

Integer GetRectangleTextureSizeX(Integer rectangleIndex)

Parameters
rectangleIndexThe index in the range from 0 to GetNumberOfRectangles()-1.
Returns
Integer The horizontal reference size.

GetRectangleTextureSizeY(rectangleIndex)

Get the vertical texture reference size for a given rectangle.

Integer GetRectangleTextureSizeY(Integer rectangleIndex)

Parameters
rectangleIndexThe index in the range from 0 to GetNumberOfRectangles()-1.
Returns
Integer The vertical reference size.

IsRectangleRotated(rectangleIndex)

Check if a given rectangle is rotated by 90 degrees in counter-clockwise direction.

Integer IsRectangleRotated(Integer rectangleIndex)

Parameters
rectangleIndexThe index in the range from 0 to GetNumberOfRectangles()-1.
Returns
Integer true if rotated.