pixijs-events

Configure PixiJS federated events for pointer, mouse, touch, and wheel interactions.

16|8|Updated May 20, 2020
One-click install
npx skills add https://github.com/encounterplus/web-client --skill pixijs-events-encounterplus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pixijs-events
Source: https://github.com/encounterplus/web-client/tree/main/.agents/skills/pixijs-events
Command: npx skills add https://github.com/encounterplus/web-client --skill pixijs-events-encounterplus

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about pixijs-events

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle PixiJS drag and drop events when the pointer moves outside the sprite bounds?

PixiJS drag and drop tracking outside sprite bounds requires listening to globalpointermove events. By attaching globalpointermove handlers, the interactive display object continues updating its position even when pointer movement exits the original hit area during active drag interactions.

What is the correct way to configure PixiJS federated events for cross-device pointer input?

PixiJS federated events require setting eventMode to static on display objects to receive pointer, mouse, touch, and wheel interactions. You must also configure hitArea and interactiveChildren properties to ensure events fire predictably across different device input types.

How do I stop event propagation in PixiJS to prevent overlapping interactive elements from firing?

PixiJS event propagation is controlled using stopPropagation within federated event handlers. Applying stopPropagation during the capture phase or target phase prevents overlapping interactive display objects from simultaneously processing the same pointer input events.

Why are my PixiJS pointer events not firing on interactive sprites despite setting them to static?

PixiJS pointer events fail to fire when hitArea is misconfigured or interactiveChildren overrides hit testing on nested display objects. Verify that eventMode is properly set and that globalMove or eventFeatures settings are enabled for global pointer tracking.

Can I apply native DOM-like cursor styling and feedback to PixiJS interactive UI elements?

PixiJS cursor styling is applied by configuring cursor and cursorStyles properties on interactive display objects. Setting eventMode to static enables federated events to automatically manage cursor feedback for pointer and touch interactions across the scene graph.