tilemap_get_tileset


描述

Using this function you can retrieve the index value of the tile set resource assigned to a given tilemap element on a layer. You give the tilemap element ID (which you get when you create a tilemap element using layer_tilemap_create() or when you use the function layer_tilemap_get_id()), and the function will return the tile set index value.


语法:

tilemap_get_tileset(tilemap_element_id);


参数:

参数 描述
tilemap_element_id The unique ID value of the tilemap element to get the tile set from


返回:

Tile Set index value (Real)


例如:

var lay_id = layer_get_id("Tiles_trees");
var map_id = layer_tilemap_get_id(lay_id);
if tilemap_get_tileset(map_id) != ts_Nighttime
   {
   tilemap_tileset(map_id, ts_Nighttime);
   }

The above code checks the current tile set assigned to the layer "Tiles_trees" and if it is not "ts_Nighttime" then that tile set is assigned to the tilemap.