layer_background_get_htiled


描述

This function can be used to find out if the background element is 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 the function will return either true if the element is currently tiled, or false if it is not.


语法:

layer_background_get_htiled(background_element_id);


参数:

参数 描述
background_element_id The unique ID value of the background element to get the information from


返回:

Boolean(布尔值)


例如:

var lay_id = layer_get_id("Background_sky");
var back_id = layer_background_get_id(lay_id);
if !layer_background_get_htiled(back_id)
   {
   layer_background_htiled(back_id, true);
   }

The above code will get the layer ID for the layer named "Background_sky" and then use that to get the ID of the background element on that layer. This ID is then used to check if the element is tiling across the horizontal axis, and if it is not then it is set to do so.


上一页: Background Layer Functions
next: layer_background_get_vtiled
© Copyright YoYo Games Ltd. 2018 All Rights Reserved