Skip to main content

Interface: Button

Defined in: ui/utilities/create-button.ts:105

Properties​

entity​

entity: number

Defined in: ui/utilities/create-button.ts:107

The button's root entity - a RectTransformEcsComponent + SpriteEcsComponent + UiInteractableEcsComponent + UiColorTransitionEcsComponent.


interactable​

interactable: UiInteractableEcsComponent

Defined in: ui/utilities/create-button.ts:113

The button's UiInteractableEcsComponent, for reading interaction state (isHovered, isPressed, ...) or registering pointer-event listeners beyond onInvoke.


label​

label: number

Defined in: ui/utilities/create-button.ts:110

The child label entity - see createLabel.


onInvoke​

onInvoke: ForgeEvent

Defined in: ui/utilities/create-button.ts:120

Raised when the button is invoked, by a pointer click or a submit action - interactable.onInvoke, surfaced directly since registering a single listener on it is the overwhelmingly common case.