Optional
rootTarget: DisplayObjectThe holder of the event boundary.
The cursor preferred by the event targets underneath this boundary.
Emits events after they were dispatched into the scene graph.
This can be used for global events listening, regardless of the scene graph being used. It should not be used by interactive libraries for normal use.
Special events that do not bubble all the way to the root target are not emitted from here, e.g. pointerenter, pointerleave, click.
Enables the global move events. globalpointermove
, globaltouchmove
, and globalmousemove
This flag would emit pointermove
, touchmove
, and mousemove
events on all DisplayObjects.
The moveOnAll
semantics mirror those of earlier versions of PixiJS. This was disabled in favor of
the Pointer Event API's approach.
The root event-target residing below the event boundary.
All events are dispatched trickling down and bubbling up to this rootTarget
.
Adds an event mapping for the event type
handled by fn
.
Event mappings can be used to implement additional or custom events. They take an event coming from the upstream scene (or directly from the PIXI.EventSystem) and dispatch new downstream events generally trickling down and bubbling up to PIXI.EventBoundary.rootTarget this.rootTarget.
To modify the semantics of existing events, the built-in mapping methods of EventBoundary should be overridden instead.
The type of upstream event to map.
The mapping method. The context of this function must be bound manually, if desired.
Emits the event {@code e} to all interactive display objects. The event is propagated in the bubbling phase always.
This is used in the globalpointermove
event.
The emitted event.
Optional
type: string | string[]The listeners to notify.
Optional
targets: FederatedEventTarget[]The targets to notify.
Dispatches the given event
Optional
type: stringFinds the DisplayObject that is the target of a event at the given coordinates.
The passed (x,y) coordinates are in the world space above this event boundary.
Maps the given upstream event through the event boundary and propagates it downstream.
Propagate the passed event from from PIXI.EventBoundary.rootTarget this.rootTarget to its target {@code e.target}.
The event to propagate.
Optional
type: stringFinds the propagation path from PIXI.EventBoundary.rootTarget rootTarget to the passed {@code target}. The last element in the path is {@code target}.
Generated using TypeDoc
Event boundaries are "barriers" where events coming from an upstream scene are modified before downstream propagation.
Root event boundary
The PIXI.EventSystem#rootBoundary rootBoundary handles events coming from the <canvas />. PIXI.EventSystem handles the normalization from native Events into PIXI.FederatedEvent FederatedEvents. The rootBoundary then does the hit-testing and event dispatch for the upstream normalized event.
Additional event boundaries
An additional event boundary may be desired within an application's scene graph. For example, if a portion of the scene is is flat with many children at one level - a spatial hash maybe needed to accelerate hit testing. In this scenario, the container can be detached from the scene and glued using a custom event boundary.
Memberof
PIXI