This function controls the position along the y-axis of the room of the asset tilemap element on the 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 then set the y value to use (based on the room coordinates).
tilemap_y(tilemap_element_id, y);
参数 描述 tilemap_element_id The unique ID value of the tilemap element to change x The y position for the tilemap
N/A(无返回值)
var lay_id = layer_get_id("Asset_sky");
var map_id = layer_tilemap_get_id(lay_id);
tilemap_y(map_id, irandom(room_height));
The above code gets the ID value of the tilemap asset assigned to the layer "Asset_sky" and then sets its y position to a random value between 0 and the height of the room.