tile_layer_find

Returns the id of a tile at a given depth and position.

Syntax:

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


Description

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).


Example:

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.


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