What problem does it solve?
PixiJS pointer, mouse, and touch events can be confusing to wire correctly, especially when you need consistent hit-testing, propagation behavior, drag-like global movement, and cursor feedback across device types.
Core Features & Use Cases
- Federated event handling: Listen to pointer, mouse, wheel, and touch events through PixiJS’ federated event system.
- Correct interaction setup: Configure
eventMode, interactiveChildren, hitArea, and cursor/cursorStyles so events fire exactly when and where you expect.
- Propagation, capture, and drag patterns: Use
stopPropagation, capture-phase listeners, and globalpointermove to implement reliable UI interactions like buttons, draggable objects, and interactive overlays.
- Use Case: Build a cross-device drag-and-drop UI where a sprite behaves like a clickable button when tapped, but switches to drag behavior while tracking movement even outside its bounds.
Quick Start
Set your PixiJS display object to eventMode static, attach pointertap and pointerdown/pointerup handlers, and for drag logic listen to globalpointermove to update the object while tracking continues outside its hit area.