Using this function you can change whether the given background element on a layer should be tiled vertically or not. You give the background element ID (which you get when you create a background element using layer_background_create() or when you use the function layer_background_get_id()), and then set the tiling value. If set to true then the element will be displayed tiled vertically down the room, and when set to false, the element will not be tiled.
layer_background_vtiled(background_element_id, tiled);
参数 描述 background_element_id The unique ID value of the background element to change visible The vertical tiling toggle, which can be true or false
N/A(无返回值)
var back = layer_background_get_id(layer);
if !layer_background_get_htiled(back) || !layer_background_get_vtiled(back)
{
layer_background_htiled(back, true);
layer_background_vtiled(back, true);
}
The above code will check the background element assigned to the layer the instance running the code is on and if it is not tiled in either direction it will set it to tile vertically and horizontally.