@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / components / UIButtonComponent
Class: UIButtonComponent ​
Defined in: components/UIButton.ts:31
A pressable control.
A press is CLICK-ON-RELEASE: it arms when the pinch/trigger/mouse goes down on the button and fires only if the release still points at it — sliding off cancels, matching platform UX. Scripts hear it via Behaviour.onUiPress, on the button's own entity first and then bubbling up the parent chain, carrying actionId (defaults to the entity's name) so one panel script can handle all of its buttons.
Extends ​
Constructors ​
Constructor ​
ts
new UIButtonComponent(options?): UIButtonComponent;Defined in: components/UIButton.ts:49
Parameters ​
| Parameter | Type |
|---|---|
options? | UIButtonOptions |
Returns ​
UIButtonComponent
Overrides ​
Properties ​
| Property | Type | Description | Defined in |
|---|---|---|---|
label | string | - | components/UIButton.ts:32 |
actionId | string | Dispatch identifier; empty string means "use the entity name". | components/UIButton.ts:34 |
width | number | Full width in metres. | components/UIButton.ts:36 |
height | number | Full height in metres. | components/UIButton.ts:38 |
fontSize | number | Label glyph height in metres. | components/UIButton.ts:40 |
fontWeight | number | - | components/UIButton.ts:41 |
textColor | string | - | components/UIButton.ts:42 |
backgroundColor | string | - | components/UIButton.ts:43 |
backgroundOpacity | number | - | components/UIButton.ts:44 |
cornerRadius | number | - | components/UIButton.ts:45 |
borderWidth | number | - | components/UIButton.ts:46 |
borderColor | string | - | components/UIButton.ts:47 |

