Returns the depth of a given tile.



Argument Description
index The index of the tile to check.

Returns: Real


With this function you can get the draw depth of the specified tile.


var tile, i;
for (i = 0; i > -1000; i -=1;)
   tile = tile_layer_find(i, mouse_x, mouse_y);
   if tile_get_depth(tile) != -500
      tile_set_depth(tile, -500);

The above code will loop through the tile layers from 0 to -1000 an get the index of any tile at the mouse position. It will then use that value to check whether the tile is at depth -500, and if it is not, it sets the depth to -500.

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