Skip to content

PointerEvents

Defined in: ui/src/pointer-events.ts:24

Shared hover-event fan-out for the interactive UI primitives.

Binds one pointerover / pointerout listener pair and routes them to the caller’s onPointerOver / onPointerOut / onHover callbacks. A pointer listener implies the element must be hit-testable, so a passive container (Pixi’s default — not a hit-test target itself) is upgraded to static; without this a consumeInput: false primitive with no interactive children would silently never fire. Explicit modes are left alone (UIButton toggles "none" when disabled).

Callbacks live in mutable fields swapped in place by set, so a single listener pair survives the React reconciler’s prop churn — no rebinding, no listener leak across re-renders. inert lets a primitive suppress callbacks while it’s disabled (mirrors UIButton’s existing hover-background guard). Listener teardown is implicit: every primitive destroys its container in destroy(), and Pixi’s EventEmitter drops all listeners then — matching how the primitives’ own click/bg listeners are already cleaned up.

new PointerEvents(container, props, inert?): PointerEvents

Defined in: ui/src/pointer-events.ts:30

Container

PointerEventProps

() => boolean

PointerEvents

set(props): void

Defined in: ui/src/pointer-events.ts:54

Swap callbacks in place. Called from the primitive’s update(). Uses a key-presence check (mirroring UIText’s "truncate" in p convention): a present key — including an explicit undefined, the shape the React reconciler emits when a JSX prop is removed — reassigns (and so can clear) the handler, while an absent key leaves it intact so partial imperative update({ ... }) calls don’t drop hover handlers.

PointerEventProps

void