Getter for Layers, Tilemaps, Sprites, Tiles, ..., user data for callbacks, palette tile attribute, multiple tilesets per tilemap, and bug with TLN_SetTilemapTile() #91
Hello, I noticed a quite annoying problem. There are functions to set values to an object, but no getters. Some notable exemples are layers and sprites. You can set a position to them, but not getting the positions back. So, you need to sync the positions between the user code and Tilengine. And if the sync is badly done, the user can encounter problems later, such as collisions bugs for exemple.
So my suggestion is adding functions like TLN_GetLayerPosX() (same for Y), and TLN_GetSpritePosX (same for Y). Same for the rotation of a layer / sprite, zoom, ...
There are also functions working in a weird way. For exemple the TLN_GetLayerTile() send me a boolean back, but I think it should send me the informations about the tile. Same for TLN_GetListObject(), TLN_GetSpriteInfo(). But it's just my opinion.
Another suggestion is being able to pass user data to the raster and frame callback, like the SDL audio callback.
Another cool addition is being able to select a palette per tile, like how old consoles such as the Super Nintendo and the SEGA Genesis work. They had a limited number of palettes (4 for the Genesis, 16 for the SNES) and one tile can use one of thoses 16 palettes. Same for the sprites. And also, being able to use multiple tilesets per tilemap would be nice. It would avoid to duplicate the tiles for using them in another tilemap. (For now, Tilengine supports loading one tileset per tilemap)
Finally, I think I found a bug with TLN_SetTilemapTile(). In fact, when you tell it you want to set the tile at X index of the tileset, it put the tile at X - 1. I don't know if it's intended or not (maybe you expected people to count from 1 instead of 0?), but I didn't expected this behavior.
Thanks for your answer and for taking your time to read my suggestions.
Hello, I noticed a quite annoying problem. There are functions to set values to an object, but no getters. Some notable exemples are layers and sprites. You can set a position to them, but not getting the positions back. So, you need to sync the positions between the user code and Tilengine. And if the sync is badly done, the user can encounter problems later, such as collisions bugs for exemple.
So my suggestion is adding functions like TLN_GetLayerPosX() (same for Y), and TLN_GetSpritePosX (same for Y). Same for the rotation of a layer / sprite, zoom, ...
There are also functions working in a weird way. For exemple the TLN_GetLayerTile() send me a boolean back, but I think it should send me the informations about the tile. Same for TLN_GetListObject(), TLN_GetSpriteInfo(). But it's just my opinion.
Another suggestion is being able to pass user data to the raster and frame callback, like the SDL audio callback.
Another cool addition is being able to select a palette per tile, like how old consoles such as the Super Nintendo and the SEGA Genesis work. They had a limited number of palettes (4 for the Genesis, 16 for the SNES) and one tile can use one of thoses 16 palettes. Same for the sprites. And also, being able to use multiple tilesets per tilemap would be nice. It would avoid to duplicate the tiles for using them in another tilemap. (For now, Tilengine supports loading one tileset per tilemap)
Finally, I think I found a bug with TLN_SetTilemapTile(). In fact, when you tell it you want to set the tile at X index of the tileset, it put the tile at X - 1. I don't know if it's intended or not (maybe you expected people to count from 1 instead of 0?), but I didn't expected this behavior.
Thanks for your answer and for taking your time to read my suggestions.