sprites-and-images

Create and manage Phaser 4 Sprite and Image objects with factory methods.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Coordinate and standardize the creation and manipulation of Sprite and Image game objects in Phaser 4, reducing boilerplate and ensuring consistent behavior across scenes.

Core Features & Use Cases

  • Factory-based creation via this.add.sprite and this.add.image
  • Shared component mixins for Transform, Size, Origin, Depth, Tint, Alpha, and Flip
  • Real-world scenario: quickly render a player with correct frame, texture, origin, and depth, and adjust visuals at runtime
  • Use cases: prototyping UI assets, rapid gameplay object generation, and consistent rendering across assets

Quick Start

Create a sprite in a scene using the add.sprite helper with a texture key and optional frame, then chain a few visual tweaks like position and scale.

Frequently Asked Questions about sprites-and-images

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

FAQPage Schema
How do I create and manage sprites in Phaser 4 scenes?â–¼

To create and manage sprites in Phaser 4, you use factory creation via this.add.sprite and this.add.image, then apply component mixins for Transform, Size, Origin, Depth, Tint, Alpha, and Flip to ensure consistent behavior across scenes.

When do I use sprites vs images for rendering game objects in Phaser?â–¼

Sprites and images are used for rendering game objects in Phaser when you need texture and frame handling, precise positioning, sizing, tinting, flipping, and depth control for rendering visual assets in your scenes.

How do I adjust position, scale, and tint of a game object after creation?â–¼

You adjust position, scale, and tint of a game object after creation by chaining visual tweaks directly on the factory-created object using the built-in Transform, Tint, and Alpha component mixins.

Does this approach require specific dependencies to standardize game object behavior?â–¼

No specific dependencies are required to standardize game object behavior, as the approach integrates core component mixins like Transform, Origin, and Depth directly within your Phaser scenes to reduce boilerplate.

What is the best way to reduce boilerplate when rendering multiple game objects?â–¼

The best way to reduce boilerplate when rendering multiple game objects is using factory-based creation with this.add.sprite, which automatically integrates shared component mixins for consistent visual behavior across assets.

Why are my Phaser sprites rendering with inconsistent origins and depths across scenes?â–¼

Inconsistent origins and depths occur when component mixins are not standardized; applying the shared Origin and Depth mixins during factory creation ensures uniform rendering and positioning across all scenes.