sb.getLayerAttrs

sb.getLayerAttrs(layer_name, tags...)

Get properties for a layer instance associated with a particular screen. The layer_name specifies either the fully qualified name of a layer instance using the ScreenName.LayerName naming convention or, if only the layer name is specified, the name will refer to a layer instance associated with the current screen The tags are a list of string properties associated with the layer instance and can include one or more of the following values:

x

y

width

height

alpha

hidden

xoffset

yoffset

scroll_enabled

geometry

A JS object containing the keys and their respective values is returned or nil if the layer can not be found.

Parameters:
    layerName         The model full path of the layer to get information about
    tags              One or more tags as strings

Returns:
    A JS Object containing the tags as keys with the associated object value being the Storyboard value associated with that tag.
Example:

function checkIfHidden() {    
    // check if my_layer is currently hidden    
    var data = sb.getLayerAttrs("my_layer", "hidden")    
    if(data.hidden == 1) {        
        print("my_layer is currently hidden")    
    } else {        
        print("my_layer is currently visible")    
    }
}
Was this article helpful?
0 out of 0 found this helpful