tile_get_background

Returns the background index a given tile is drawn from.

Syntax:

tile_get_background(index);


Argument Description
index The index of the tile to check.


Returns: Real


Description

With this function you can get the background_index from which the tile is taken. Please note that this function returns the index (unique identifier) which is a number and not the name of the background asset, which would be a string.


Example:

var tile;
tile = tile_layer_find(-1000, mouse_x, mouse_y);
back = tile_get_background(tile);

The above code will first get the index of a tile at the mouse position with a depth of -1000 and then use that value to store the background index of the asset it was created from in the variable "back".


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