phaserjs avatar

Sprites And Images

This covers the fundamentals of working with sprites and images in Phaser 4: factory methods, texture and frame selection, and all the visual properties you'd expect like position, scale, rotation, tint, flip, alpha, origin, and depth. The documentation clearly explains when to use Image versus Sprite (basically, use Image unless you need animations, since it skips the per-frame update cost), and digs into the component mixin system that both classes share. Good reference material for the common chaining patterns and the differences from Phaser 3, like how setTintFill is gone in favor of setTint plus setTintMode. If you're building anything visual in Phaser 4, you'll be using these methods constantly.

skills.sh installs
1.2K
GitHub stars
40.7K
last updated
Aug 21, 2026

Install

$ npx -y skills add phaserjs/phaser --skill sprites-and-images --agent claude-code

Installs into .claude/skills of the current project.

Files

Sprites and Images

Creating and manipulating Sprite and Image game objects in Phaser 4 -- factory methods, texture/frame selection, the component mixin system, and common visual operations (position, scale, rotation, tint, flip, alpha, origin, depth).

Key source paths: src/gameobjects/sprite/, src/gameobjects/image/, src/gameobjects/GameObject.js, src/gameobjects/components/ Related skills: ../loading-assets/SKILL.md, ../animations/SKILL.md, ../physics-arcade/SKILL.md, ../game-object-components/SKILL.md

Quick Start

// In a Scene's create() method:

// Static image (no animation support, slightly cheaper)
const bg = this.add.image(400, 300, 'background');

// Sprite (supports animations)
const player = this.add.sprite(100, 200, 'player', 'idle-0');

// Common operations -- all methods return `this` for chaining
player.setPosition(200, 300);
player.setScale(2);
player.setAngle(45);
player.setTint(0xff0000);
player.setAlpha(0.8);
player.setOrigin(0, 1);       // bottom-left
player.setDepth(10);
player.setFlip(true, false);  // flip horizontally
player.setVisible(false);

Sponsors

Details

Repository
github.com/phaserjs/phaser
Categories
Frontend Development, Game Development
First seen
Jun 3, 2026

More from phaserjs/phaser

All 8
1bradautomates avatartiktok-researchbradautomates/head-of-contentResearch high-performing TikTok videos from tracked accounts using Apify's TikTok Scraper. Identifies outlier content, analyzes top 5 videos with AI, and genera1.2Kskills.sh installs
2vtex avatarvtex-io-app-settingsvtex/skillsApply when defining, validating, or consuming VTEX IO app settings. Covers settingsSchema, app-level configuration boundaries, and how backend or frontend code 1.2Kskills.sh installs
3customware-ai avatarcpq-buildercustomware-ai/skillsConfigure-Price-Quote (CPQ) vertical skill for the Customware SPA. Defines patterns, minimum standards, layout patterns, lifecycle indicators, product configura1.2Kskills.sh installs
4software-mansion-labs avatarexpo-horizonsoftware-mansion-labs/skillsSoftware Mansion's guide for migrating Expo SDK apps to Meta Quest using expo-horizon packages. Use when adding Meta Quest or Meta Horizon OS support to an exis1.2Kskills.sh installs
5cursor avatarcreate-plugin-scaffoldcursor/pluginsCreate a new Cursor plugin scaffold with a valid manifest, component directories, and marketplace wiring.1.2Kskills.sh installs
6llama-farm avatarcode-reviewllama-farm/llamafarmComprehensive code review for diffs. Analyzes changed code for security vulnerabilities, anti-patterns, and quality issues. Auto-detects domain (frontend/backen1.2Kskills.sh installs