Spriteset resources management for sprites.
More...
Spriteset resources management for sprites.
◆ TLN_CreateSpriteset()
Creates a new spriteset.
- Parameters
-
bitmap | Bitmap containing the sprite graphics |
data | Array of TLN_SpriteData structures with sprite descriptions |
num_entries | Number of entries in data[] array |
- Returns
- Reference to the created spriteset, or NULL if error
- See also
- TLN_DeleteSpriteset()
◆ TLN_LoadSpriteset()
Loads a spriteset from an image png and its associated atlas descriptor.
- Parameters
-
name | Base name of the files containing the spriteset, with or without .png extension |
- Returns
- Reference to the newly loaded spriteset or NULL if error
◆ TLN_CloneSpriteset()
Creates a duplicate of the specified spriteset and its associated palette.
- Parameters
-
- Returns
- A reference to the newly cloned spriteset, or NULL if error
- See also
- TLN_LoadSpriteset()
◆ TLN_GetSpriteInfo()
Query the details about the specified sprite inside a spriteset.
- Parameters
-
spriteset | Reference to the spriteset to get info about |
entry | The entry index inside the spriteset [0, num_sprites - 1] |
info | Pointer to application-allocated TLN_SpriteInfo structure that will receive the data |
- Returns
- true if success or false if error
◆ TLN_GetSpritesetPalette()
Returns a reference to the palette associated to the specified spriteset.
- Parameters
-
spriteset | Spriteset to obtain the palette |
- See also
- TLN_SetSpritePalette()
◆ TLN_FindSpritesetSprite()
int TLN_FindSpritesetSprite |
( |
TLN_Spriteset |
spriteset, |
|
|
const char * |
name |
|
) |
| |
Returns a reference to the palette associated to the specified spriteset.
- Parameters
-
spriteset | Spriteset where to find the sprite |
name | Name of the sprite to findo |
- Returns
- sprite index (0 -> num_sprites - 1) if found, or -1 if not found
◆ TLN_SetSpritesetData()
Sets attributes and pixels of a given sprite inside a spriteset.
- Parameters
-
spriteset | Spriteset to set the data |
entry | The entry index inside the spriteset to modify [0, num_sprites - 1] |
data | Pointer to a user-provided TLN_SpriteData structure with sprite description |
pixels | Pointer to source pixel data |
pitch | Number of bytes per scanline of the source pixel data |
- See also
- TLN_CreateSpriteset()
◆ TLN_DeleteSpriteset()