Hi there,
I would like to know if it’s possible to show and hide tiles programmatically please ? I have a layer which is invisible but I would like to put a tile visible when the player is on it, something like that.
Thanks in advance.
Hi there,
I would like to know if it’s possible to show and hide tiles programmatically please ? I have a layer which is invisible but I would like to put a tile visible when the player is on it, something like that.
Thanks in advance.
Sure. You can read and set the content of a tile with http://www.defold.com/ref/tilemap/#tilemap.get_tile and http://www.defold.com/ref/tilemap/#tilemap.set_tile
I already read it but it doesn’t work for me When I do tilemap.get_tile() it returns me “nil” with “Could not get the tile since the supplied tile was out of range.”
Oh yeahh I made it work
tilemap.set_tile(“tilemap”, “ground”, go.get_position().x / tile_size, go.get_position().y / tile_size, 0)