Checks if a given tile exists in the room.



Argument Description
index The index of the tile to check for.

Returns: Boolean


With this function you can check wither the tile indexed exists in the room or not. Please note that if you check for a tile by its id and its id is uninitialised, an error will be thrown.


if !tile_exists(tile)
   tile = tile_add(bck_Room1, 0, 0, 32, 32, mouse_x, mouse_y, -1100);

The above code checks to see if a tile that was indexed in the variable "tile" still exists in the room, and if it does not it creates a new tile at the mouse position and stores the new index in the variable "tile".

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