11-03-2022, 04:44 PM
Hi!
Glad you like this new feature :-)
Unfortunately Tiled editor doesn't allow setting custom properties on individual tilemap cells, only on tileset tiles. The only way to set palette bits on a tilemap cell at runtime is using combination of TLN_GetTilemapTile() / TLN_SetTilemapTile(), or the new TLN_GetTilemapTiles() that is more efficient but more dangerous too.
Only specific tilemap editors for consoles allow setting attribute flags directly on tilemap cells, but they're tightly tied to the features and limitations of each console. Tiled is more versatile and open-ended, but lacks this feature.
There is a workaround in Tilengine that is already implemented for "priority" attribute, and could be done for palette index too. The idea is to set the property to specific tiles in the .tsx (tileset) editor. When you set up a tilemap layer with TLN_SetLayerTilemap(), the engine "transfers" priority attribute of tiles on the tileset to tilemap cells. Same could be done with a "palette" attribute. However, this is a hack: priority and palette flags should be applied individually to selected tilemap cells, but with this method they're mass-applied to all tilemap cells with the same graphic (tile id). So you can't have the same graphic used on different parts of the map with different priority or palette on each place.
What do you think about implementing a "palette"property in tileset?
Just for curiosity I'll research a bit about file formats of specific console editors, peraphs I may write loaders for Tilengine in the future
Glad you like this new feature :-)
Unfortunately Tiled editor doesn't allow setting custom properties on individual tilemap cells, only on tileset tiles. The only way to set palette bits on a tilemap cell at runtime is using combination of TLN_GetTilemapTile() / TLN_SetTilemapTile(), or the new TLN_GetTilemapTiles() that is more efficient but more dangerous too.
Only specific tilemap editors for consoles allow setting attribute flags directly on tilemap cells, but they're tightly tied to the features and limitations of each console. Tiled is more versatile and open-ended, but lacks this feature.
There is a workaround in Tilengine that is already implemented for "priority" attribute, and could be done for palette index too. The idea is to set the property to specific tiles in the .tsx (tileset) editor. When you set up a tilemap layer with TLN_SetLayerTilemap(), the engine "transfers" priority attribute of tiles on the tileset to tilemap cells. Same could be done with a "palette" attribute. However, this is a hack: priority and palette flags should be applied individually to selected tilemap cells, but with this method they're mass-applied to all tilemap cells with the same graphic (tile id). So you can't have the same graphic used on different parts of the map with different priority or palette on each place.
What do you think about implementing a "palette"property in tileset?
Just for curiosity I'll research a bit about file formats of specific console editors, peraphs I may write loaders for Tilengine in the future