tilemap_get_tile_height

Using this function you can retrieve the height (in pixels) of each tile cell of the tile map element. You give the tile map element ID (which you get when you create a tile map element using layer_tilemap_create() or when you use the function layer_tilemap_get_id()), and the function will return the tile set cell height.

 

Syntax:

tilemap_get_tile_height(tilemap_element_id);

ArgumentType Description
tilemap_element_idTile Map Element ID The unique ID value of the tile map element to get the tile cell height of

 

Returns:

Real

 

Example:

var lay_id = layer_get_id("Tiles_Walls");
var map_id = layer_tilemap_get_id(lay_id);
global.snap_x = tilemap_get_tile_width(map_id);
global.snap_y = tilemap_get_tile_height(map_id);

The above code uses the retrieved tile map ID to get the tile cell width and height and use them to set two global variables.