gre.set_layer_attrs
gre.set_layer_attrs(
layer_name,
tag_table
)
Set 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
x, y, width, height, alpha, hidden, xoffset, yoffset, scroll_enabled, geometry
The scroll enablement value can only be set if the layer had scrolling enabled in Designer.
Parameters
| Parameter | Type | Description |
|---|---|---|
layer_name | #string | The model full path of the layer to change properties on. |
tag_table | #table | A table with tags as the keys and the new values stored as the table's key values. |
Example
function set_layer_hidden()
local data = {}
data.hidden = 1
gre.set_layer_attrs("my_layer", data)
end
Geometry
This effect will allow custom OpenGL ES geometry to be applied to the rendering of the control or layer. This includes custom vertices and UV coordinates. The following attributes are defined:
Parameters: width The viewport width for the content height The viewport height for the content type The type of primitive to render: fan | triangles nvert The number of vertex coordinates. Options are 2 (x,y) and 3 (x, y, z) nuv The number of UV coordinates. Options are 2 or 0 data The table containing the vertex data Example:function cbSetGeometry(mapargs)
local gdata = {}
local dz = 0.0
local offset = mapargs.offset
local dz2 = -offset
local w
local h = 240
dz2 = -offset
w = 320 - offset
gdata = {
{x=w/2, y=h/2, z=dz2, u=0.5, v=0.5},
{x=w, y=0, z=dz, u=1.0, v=0},
{x=w/2, y=0, z=dz2, u=0.5, v=0},
{x=0, y=0, z=dz, u=0, v=0},
{x=0, y=h, z=dz, u=0, v=1.0},
{x=w/2, y=h, z=dz2, u=0.5, v=1.0},
{x=w, y=h, z=dz, u=1.0, v=1.0},
{x=w, y=0, z=dz, u=1.0, v=0},
}
local attrs = {}
attrs["geometry"] = {
width = w,
height = h,
type = "fan",
nvert = 3,
nuv = 2,
data = gdata
}
gre.set_layer_attrs("geometry.layer3",attrs)
end