tilemap_set_height

描述

This function can be used to resize a tilemap element. 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 new height of the tilemap in tile cells.


语法:

tilemap_set_height(tilemap_element_id, height)


参数:

参数 描述
tilemap_element_id The unique ID value of the tilemap element to set the height of
高度 The height value (in "cells")


返回:

N/A(无返回值)


例如:

var lay_id = layer_get_id("Tiles_Walls");
var map_id = layer_tilemap_get_id(lay_id);
if tilemap_get_height(map_id) != room_height div 16
    {
    tilemap_set_height(map_id, room_height div 16);
    }

The above code checks the width of a specific tilemap and if it is not the correct size then the width is set.