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:
Type | Description |
---|---|
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:
Name | Type | Description | Default |
---|---|---|---|
path | String | - | - |
Returns:
Type | Description |
---|---|
Vector4 | - |
Example:
myAtlas:getSpriteUV(myAtlas:listSprites()[1])
getWidth()
Returns the width of this atlas
getWidth()
Returns:
Type | Description |
---|---|
Integer | - |
Example:
myAtlas:getWidth()
listSprites()
Returns a table with all sprite paths under this atlas
listSprites()
Returns:
Type | Description |
---|---|
Table | - |
Example:
myAtlas:listSprites()