gre.resize_control
gre.resize_control(
control_name,
dw,
dh,
w,
h,
[ah],
[av]
)
Resize a control. The control_name is the name of the control or a variable. Setting dw and or dh will resize the control by the specified delta from its current size. The dw and dh values can be 0 to set an absolute position using the w and h values only.
Optional anchors can allow for automatic adjustment of the control's x and y positions to keep the control anchored in the desired position as the control's size change:
Horizontal:
-
gre.LEFTanchor will not adjust the control's x position. This is the default behavior. -
gre.CENTERanchor will adjust the control's x position by half the difference in control width. -
gre.RIGHTanchor will adjust the control's x position by the difference in control width.
Vertical:
-
gre.TOPanchor will not adjust the control's y position. This is the default behavior. -
gre.CENTERanchor will adjust the control's y position by half the difference in control height. -
gre.BOTTOManchor will adjust the control's y position the difference in control height.
Parameters
| Parameter | Type | Description |
|---|---|---|
control_name | #string | The model full path of the control to move. |
dx | #number | A delta from the current x position or 0 to move using x. |
dy | #number | A delta from the current y position or 0 to move using y. |
x | #number | The x position to move to in absolute co-ordinates (omit to use dx). |
y | #number | The y position to move to in absolute co-ordinates (omit to use dy). |
ah | #number | The horizontal anchor, gre.LEFT, gre.CENTER or gre.RIGHT [Optional, default is gre.LEFT]. |
vh | #number | The vertical anchor, gre.TOP, gre.CENTER or gre.BOTTOM [Optional, default is gre.TOP]. |