ObjectList resources management.
More...
ObjectList resources management.
◆ TLN_CreateObjectList()
Creates a TLN_ObjectList The list is created empty, it must be populated with TLN_AddSpriteToList() and assigned to a layer with TLN_SetLayerObjects()
- Returns
- Reference to new object or NULL if error
◆ TLN_AddTileObjectToList()
bool TLN_AddTileObjectToList |
( |
TLN_ObjectList |
list, |
|
|
uint16_t |
id, |
|
|
uint16_t |
gid, |
|
|
uint16_t |
flags, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
Adds an image-based tileset item to given TLN_ObjectList.
- Parameters
-
list | Reference to TLN_ObjectList |
id | Unique ID of the tileset object |
gid | Graphic Id (tile index) of the tileset object |
flags | Combination of FLAG_FLIPX, FLAG_FLIPY, FLAG_PRIORITY |
x | Layer-space horizontal coordinate of the top-left corner |
y | Layer-space bertical coordinate of the top-left corner |
- Returns
- true if success or false if error
◆ TLN_LoadObjectList()
TLN_ObjectList TLN_LoadObjectList |
( |
const char * |
filename, |
|
|
const char * |
layername |
|
) |
| |
Loads an object list from a Tiled object layer.
- Parameters
-
filename | Name of the .tmx file containing the list |
layername | Name of the layer to load |
- Returns
- Reference to the loaded object or NULL if error
◆ TLN_CloneObjectList()
Creates a duplicate of a given TLN_ObjectList object.
- Parameters
-
src | Reference to the source object to clone |
- Returns
- A reference to the newly cloned object list, or NULL if error
◆ TLN_GetListNumObjects()
Returns number of items in TLN_ObjectList.
- Parameters
-
list | Pointer to TLN_ObjectList to query |
- Returns
- number of items
◆ TLN_GetListObject()
Iterates over elements in a TLN_ObjectList.
- Parameters
-
list | Reference to TLN_ObjectList to get items |
info | Pointer to user-allocated TLN_ObjectInfo struct |
- Returns
- true if item returned, false if no more items left
◆ TLN_DeleteObjectList()
Deletes object list.
- Parameters
-
list | Reference to list to delete |
- Returns
- true if success or false if error