Sets a tile's visibility.


tile_set_visible(index, visible);

Argument Description
index The index of the tile to set.
visible The visibility of the tile. true=visible, false=invisible.

Returns: N/A


Like instances, tiles can be flagged as visible or invisible. This function can change that flag, and by setting it to true you make the tile visible, or by setting it to false you can set it to invisible. This is not permanent and if the player leaves the room and returns to it again, the tile will be visible (if it was placed in the room editor and the room is not persistent).


var tile;
tile = tile_layer_find(-1000, mouse_x, mouse_y);
if !tile_get_visible(tile)
   tile_set_visible(tile, true);

The above code will first get the index of a tile at the mouse position with a depth of -1000 and then use that value to check whether the tile is visible or not, and if not set the tile to visible.

Back: Background Tiles
Next: tile_set_alpha
© Copyright YoYo Games Ltd. 2018 All Rights Reserved