layer_background_htiled

Using this function you can change whether the given background element on a layer should be tiled horizontally 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 horizontally across the room, and when set to false, the element will not be tiled. This function is for 2D projects only, and will not work correctly when a 3D camera projection is used.

 

Syntax:

layer_background_htiled(background_element_id, tiled);

ArgumentTypeDescription
background_element_idBackground Element IDThe unique ID value of the background element to change
tiledBooleanThe horizontal tiling toggle, which can be true or false

 

Returns:

N/A

 

Example:

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.