tile_get_id

Returns the unique id for the given tile index.

Syntax:

tile_get_id(index);


Argument Description
index The index of the tile to check.


Returns: Real


Description

You can use this function to get the unique tile "id" which can then be used in other functions like tile_get_xscale, tile_set_alpha(), etc... The "index" argument that the function takes is a real number from 0 up to the number of tiles in the room (which you can find using the tile_get_count() function) and the function will return the corresponding tile id or -1 if no tile with the given index exists.


Example:

var num = tile_get_count();
for (var i = 0; i < num; i++;)
   {
   tile_set_depth(tile_get_id(i), -1000);
   }

The above code will get the total number of tiles in a room, then loop through them one at a time and set their depth to -1000.


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