game-object-components

Compose Phaser 4 game object behavior from reusable component mixins.

Updated Apr 26, 2026
One-click install
npx skills add https://github.com/kehwar/pixi-square --skill game-object-components-kehwar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: game-object-components
Source: https://github.com/kehwar/pixi-square/tree/main/.agents/skills/game-object-components
Command: npx skills add https://github.com/kehwar/pixi-square --skill game-object-components-kehwar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enables developers to efficiently reuse and compose Phaser 4 game object behavior through a consistent set of component mixins like Transform, Alpha, Tint, Origin, Depth, Flip, Mask, and Lighting.

Core Features & Use Cases

  • Provides a complete reference to common components and how they are applied across Sprite, Image, Text, and Container objects.
  • Demonstrates how mixins compose shared behavior (origin, depth, transform, visibility) to reduce boilerplate and keep codebase consistent.
  • Useful for UI overlays, gameplay objects, and tooling that require predictable object composition.

Quick Start

Review the Phaser 4 component mixins by applying Transform, Origin, and Tint to a custom game object.

Frequently Asked Questions about game-object-components

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

FAQPage Schema
How do I reuse Phaser 4 game object behavior across Sprite, Image, and Text?

Apply component mixins like Transform, Alpha, Tint, Origin, and Depth to compose shared behavior across Sprite, Image, Text, and Container objects. This reduces boilerplate and maintains consistency across your codebase.

What is the best way to manage Transform and Depth in Phaser 4 game objects?

The best way to manage Transform and Depth is using the built-in component mixins. This Skill codifies a complete reference for methods like setDepth and the Transform mixin, ensuring predictable object composition for UI overlays and gameplay entities.

Can I use component mixins for UI overlays and in-game entities in Phaser 4?

Yes, component mixins are useful for UI overlays, gameplay objects, and tooling that require predictable object composition. You can apply behaviors like Origin, Flip, and Visibility to custom game objects in common Phaser 4 use cases.

How do I apply Tint and Mask components to Phaser 4 Sprites and Containers?

You apply Tint and Mask components using methods like setTint within the v4 WebGL post-processing and masking workflow. The Skill provides practical usage patterns for applying these behaviors across Sprites and Containers.

Does the Phaser 4 component system support Lighting and GetBounds for custom objects?

Yes, the Phaser 4 component system supports Lighting, GetBounds, Flip, and Mask behaviors. It provides a complete reference for applying these shared components across standard game object types like Image and Text.