Skip to main content

TextureAtlas

A texture atlas object, with helper functions related to a texture atlas

warning

This page is a WIP. It contains all the information in Figura's documentation but we're working on adding more helpful descriptions.

For this entire page assume:

local myAtlas = client.getAtlas(client.listAtlases()[1])

getHeight()

Returns the height of this atlas

getHeight()

Returns:

TypeDescription
Integer-

Example:

myAtlas:getHeight()

getSpriteUV()

Returns a vec4 containing the UV of the given sprite

The UV is ordered as U0, V0, U1, V1

getSpriteUV(path)

Parameters:

NameTypeDescriptionDefault
pathString--

Returns:

TypeDescription
Vector4-

Example:

myAtlas:getSpriteUV(myAtlas:listSprites()[1])

getWidth()

Returns the width of this atlas

getWidth()

Returns:

TypeDescription
Integer-

Example:

myAtlas:getWidth()

listSprites()

Returns a table with all sprite paths under this atlas

listSprites()

Returns:

TypeDescription
Table-

Example:

myAtlas:listSprites()