- Home /
How do I read from TilePalette?
Hello everyone! So, my goal is to programmatically fill the tilemap. Lets assume I have level data serialized as follows:
{
tilePalette: 'snow_forest',
floor: ['brick', 'brick', 'water', 'brick'],
walls: ['stone', 'none', 'none', 'stone'],
decals: ['none', 'lamp', 'none', 'none']
}
I have a scene with grid object that have 3 tilemaps inside (Floor, Walls and Decals obviously). I feed level data to my script, it reads the arrays and spawns tiles into corresponding tilemap from the 'snow_forest' palette.
Problem is I don't know how to load named tile\tile by an index from the palette. And Im not sure if there's even a way to do it.
If there are different ways to fill the tilemap with certain tiles from a certain palette - I'll be glad to know :)
Comment