Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getter for Layers, Tilemaps, Sprites, Tiles, ..., user data for callbacks, palette tile attribute, multiple tilesets per tilemap, and bug with TLN_SetTilemapTile() #91

Open
system64MC opened this issue Mar 8, 2022 · 0 comments

Comments

@system64MC
Copy link

system64MC commented Mar 8, 2022

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.

@system64MC system64MC changed the title Getter for Layers, Tilemaps, Sprites, Tiles, ..., user data for callbacks, and bug with TLN_SetTilemapTile() Getter for Layers, Tilemaps, Sprites, Tiles, ..., user data for callbacks, palette tile attribute, and bug with TLN_SetTilemapTile() Mar 8, 2022
@system64MC system64MC changed the title Getter for Layers, Tilemaps, Sprites, Tiles, ..., user data for callbacks, palette tile attribute, and bug with TLN_SetTilemapTile() Getter for Layers, Tilemaps, Sprites, Tiles, ..., user data for callbacks, palette tile attribute, multiple tilesets per tilemap, and bug with TLN_SetTilemapTile() Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant