Commonprops
Overview
commonProps keeps only the state fields common to all nodes.
A node's outer-frame size is not part of commonProps. Size/box constraints such as width, height, aspectRatio all live in
placement; commonProps.zoom / pivotX / pivotY only handle the transform applied after layout.
Field Table
Key |
Type |
Default |
Binding |
UI Effect / Limits |
|---|---|---|---|---|
|
bool |
|
|
controls the node's hidden state; the show/hide animation triggers on changes to this field |
|
bool |
|
|
controls the disabled state |
|
bool |
control-type baseline |
|
controls whether the node receives click-type events |
|
bool |
control-type baseline |
|
controls whether scrolling is allowed |
|
bool |
|
|
controls whether the node stays locked as the pressed target when the press slides outside the node bounds |
|
integer degrees |
|
|
general node rotation angle |
|
integer |
|
|
general node scale value; |
|
integer px or percent string |
|
|
X coordinate of the general rotation/scale pivot; e.g. |
|
integer px or percent string |
|
|
Y coordinate of the general rotation/scale pivot; e.g. |
Baseline Default Value
The default of clickable comes from the built-in baseline:
labeldefaults tofalseother regular nodes such as
screen,container,button,imagedefault totrue
The default of scrollable also comes from the built-in baseline:
screen,containerdefault totrueother regular nodes such as
label,button,imagedefault tofalse
Example
"commonProps": {
"hidden": true,
"disabled": false,
"clickable": true,
"scrollable": false,
"pressLock": true,
"angle": 15,
"zoom": 256,
"pivotX": "50%",
"pivotY": "50%"
}
scrollable: true asks the backend to enable scrolling; scrollable: false asks the backend to disable scrolling.
pressLock: true means that even if the pointer leaves the node bounds after a press, the backend tries to keep this node as the current pressed target.
If a control needs to receive pressLost when the press slides out of bounds and cancel the subsequent effective click, set pressLock: false.
pivotX / pivotY accept a bare integer px or a percentage string. A percentage is computed against the node's current size: pivotX uses node width, pivotY uses node height.