pixijs-events

Configure PixiJS v8 federated event modes, hit areas, and cursor behavior.

Updated Mar 13, 2022
One-click install
npx skills add https://github.com/alexkafer/alexkafer-web --skill pixijs-events-alexkafer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pixijs-events
Source: https://github.com/alexkafer/alexkafer-web/tree/main/.agents/skills/pixijs-events
Command: npx skills add https://github.com/alexkafer/alexkafer-web --skill pixijs-events-alexkafer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PixiJS developers often struggle with why pointer events don’t fire, how to configure hit testing, and how to use propagation, capture, and global move events correctly in the federated event system.

Core Features & Use Cases

  • Event-mode configuration: Choose the right eventMode (none, passive, auto, static, dynamic) to control which objects participate in interaction.
  • Correct event handling & propagation: Use .on(), addEventListener, or property handlers, plus stopPropagation/capture-phase listeners to control how events bubble.
  • Hit testing and interaction behavior: Tune hitArea, interactiveChildren, and cursor behavior (including cursor styles) to get expected results, including drag via globalpointermove.
  • Typical use cases: Buttons/UI clicks, drag-and-drop mechanics, global hover/drag tracking, and optimizing event-heavy scenes for performance.

Quick Start

Set your interactive object to eventMode = "static", assign an optional cursor, and listen for pointertap to handle clicks with event.global coordinates.

Frequently Asked Questions about pixijs-events

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

FAQPage Schema
Why are my PixiJS pointer events not firing on scene-graph objects?

PixiJS pointer events fail when the object's `eventMode` is not set to `static` or `dynamic`. Configuring `eventMode` correctly ensures the object participates in hit testing and receives federated input events.

How do I configure hit testing and interactive children in PixiJS v8?

Configure hit testing in PixiJS v8 by defining a custom `hitArea` geometry and toggling `interactiveChildren` to control nested object interaction, ensuring accurate federated event targeting and expected cursor behavior.

What is the best way to handle drag-and-drop mechanics with PixiJS federated events?

Handle PixiJS drag-and-drop mechanics by setting `eventMode` to `static` and listening to `globalpointermove` events, tracking pointer movement globally to allow reliable drag handling across the scene graph.

How does event propagation and capture phase work in the PixiJS event system?

Event propagation in the PixiJS event system bubbles through the scene graph hierarchy; use `stopPropagation` to halt bubbling and add capture-phase listeners to intercept federated events before they reach their target.

Does PixiJS v8 support touch, wheel, and mouse events through the federated event system?

Yes, PixiJS v8 federated events support touch, wheel, and mouse inputs via `FederatedPointerEvent` and `FederatedWheelEvent`; configure `eventFeatures` to enable deterministic listener setups across devices.

When should I use different eventMode settings to optimize event-heavy PixiJS scenes?

Optimize event-heavy PixiJS scenes by setting non-interactive objects to `eventMode='none'` or `'passive'`, reserving `'static'` or `'dynamic'` for interactive UI to reduce hit testing overhead and improve performance.