pixijs-math

Perform PixiJS v8 coordinate, matrix, and shape math operations.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid mistakes when converting coordinates, building affine transforms, and performing reliable shape hit testing and rectangle math in PixiJS.

Core Features & Use Cases

  • Coordinate transforms & spaces: Convert points between local and global spaces using Container helpers like toGlobal and toLocal.
  • 2D affine matrix work: Build, apply, invert, and decompose Matrix transforms for predictable movement, rotation, scaling, and layout logic.
  • Shapes, bounds, and interaction testing: Use Rectangle, Circle, Ellipse, Polygon, RoundedRectangle, and Triangle methods (contains, intersects, getBounds, strokeContains) for accurate UI interaction and culling/layout calculations, including math-extras geometry and intersection helpers.

Quick Start

Use the pixijs-math skill to compute a world-space point from a child container and then verify whether it lands inside a Rectangle-shaped hit area.

Frequently Asked Questions about pixijs-math

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

FAQPage Schema
How do I convert local coordinates to global space in PixiJS?

PixiJS coordinate transforms use Container helpers like toGlobal and toLocal to convert points between spaces, while Matrix apply and applyInverse methods handle affine transformations for predictable movement, rotation, and scaling.

How does hit testing work for shapes and stroke-based interactions in PixiJS?

Hit testing in PixiJS uses shape methods like contains, intersects, and strokeContains on Rectangle, Circle, Polygon, and other geometry primitives, with math-extras helpers providing accurate intersection and containment checks for UI interaction layers.

How do I decompose and apply affine matrices for layout logic in PixiJS?

PixiJS affine matrix work involves building, applying, inverting, and decomposing Matrix transforms to achieve predictable movement, rotation, scaling, and layout logic, using decompose to extract position, scale, and rotation components.

Does PixiJS v8 support math-extras geometry and intersection helpers?

PixiJS v8 supports math-extras geometry and intersection helpers, providing vector and intersection utilities that work alongside core primitives like Point, ObservablePoint, and Matrix for coordinate conversion and shape containment checks.

What's the best way to calculate rectangle bounds, padding, and fit scaling in PixiJS?

Rectangle bounds, padding, fit, and ceil scaling in PixiJS are handled through Rectangle methods and math-extras geometry helpers, enabling accurate culling and layout calculations for rendering and UI layers.

Why should I not use temporary shared objects across multiple expressions in PixiJS math?

Temporary shared objects in PixiJS math should only be used within a single expression to avoid mutation conflicts, since shared Point or Matrix instances can be overwritten by subsequent operations if referenced beyond their intended scope.