tile_layer_find(depth, x, y);
Argument | Description |
---|---|
depth | The depth of the tile to be found. |
x | The x position to check. |
y | The y position to check. |
Returns: Real
All tiles that are placed in a room are given a unique
identifying number (or index) which must be used in the
functions that change specific tile properties. To get the index,
you can use this function which returns the index number of the
tile found at the specified depth and position (or it returns -1 if
no tile has been found).
var tile;
tile = tile_layer_find(-1000, mouse_x, mouse_y);
if tile != -1
{
tile_delete(tile);
}
The above code will check the mouse position for a tile at the depth -10000, and if it finds one it is deleted.