Skip to content

@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 ​

ParameterType
options?UIButtonOptions

Returns ​

UIButtonComponent

Overrides ​

Component.constructor

Properties ​

PropertyTypeDescriptionDefined in
labelstring-components/UIButton.ts:32
actionIdstringDispatch identifier; empty string means "use the entity name".components/UIButton.ts:34
widthnumberFull width in metres.components/UIButton.ts:36
heightnumberFull height in metres.components/UIButton.ts:38
fontSizenumberLabel glyph height in metres.components/UIButton.ts:40
fontWeightnumber-components/UIButton.ts:41
textColorstring-components/UIButton.ts:42
backgroundColorstring-components/UIButton.ts:43
backgroundOpacitynumber-components/UIButton.ts:44
cornerRadiusnumber-components/UIButton.ts:45
borderWidthnumber-components/UIButton.ts:46
borderColorstring-components/UIButton.ts:47