CONTROL
CONTROL is the class for Lua objects that represent Storyboard control
model objects. CONTROL extends DOMOBJECT
so objects of this type can also invoke all the functions of
`DOMOBJECT.
In Lua, this class is called gredom#control.
Member Variables
As of Storyboard 9.0, GREDOM Controls have direct member access for
grd_ attributes. Direct access allows for
both reading and writing of these properties through common Lua variable
access/assignment.
-
x- The fixed component of a controls x-position.grd_x -
y- The fixed component of a controls y-position.grd_y -
w(orwidth) - The fixed component of a control's width.grd_width -
h(orheight- The fixed component control's height.grd_height -
sx- The scaled component of a control's x-position, a factor of the parent's width inherited by this control.grd_sx -
sy- The scaled component of a control's y-position, a factor of the parent's height inherited by this control.grd_sy -
sw- The scaled component of a control's width, a factor of the parent's width inherited by this control.grd_sw -
sh- The scaled component of a control's height, a factor of the parent's height inherited by this control.grd_sh -
ax- The control's horizontal anchor (gre.LEFT, gre.CENTER, gre.RIGHT). Determines how a control's x-position is interpreted, defining which point of the control is anchored to the specified x coordinate.grd_ax-
gre.LEFT- The x-position specifies the location of the left-most edge of the control. -
gre.CENTER- The x-position specifies the location of the horizontal center of the control. -
gre.RIGHT- The x-position specifies the location of the right-most edge of the control.
-
-
ay- The control's vertical anchor (gre.TOP, gre.CENTER, gre.BOTTOM). Determines how a control's y-position is interpreted, defining which point of the control is anchored to the specified y coordinate.grd_ay-
gre.TOP- The y-position specifies the location of the top-most edge of the control. -
gre.CENTER- The y-position specifies the location of the vertical center of the control. -
gre.BOTTOM- The y-position specifies the location of the bottom-most edge of the control.
-
-
pl- The control's left padding, used to determine the client area for children of this control.grd_pl -
pt- The control's top padding, used to determine the client area for children of this control.grd_pt -
pr- The control's right padding, used to determine the client area for children of this control.grd_pr -
pb- The control's bottom padding, used to determine the client area for children of this control.grd_pb -
active- A control is active by default, when false this control will not receive targeted events such as press/release/motion/touch events.grd_active -
hidden- The control's hidden state, when true a control will not be visible.grd_hidden -
clip_disabled- Enable/disable clipping for children of the control, default is false.grd_clip_disabled -
mask_enabled- Enable/disable the control's mask render extension, default is false.grd_mask_enabled -
opaque- Event opacity, when opaque, a control will not allow press/release/motion/touch events to propagate to objects behind it on-screen.grd_opaque -
findex- A control's focus index, used for focus-driven control navigation.grd_findex -
zindex- A control's z-index value which determines it's order among it's peers on its parent.grd_zindex
Direct access allows for both reading and writing of these properties through common Lua variable access/assignment.
Example:
local control = gredom.get_control("MyLayer.MyControl")
print("Old width", control.w)
control.w = 150
print("New width", control.w)
All of the above listed member variables have an equivalent get_ and set_ function available,
should it be required. For convenience, any property in the above list can be accessed through a getter and setter method.