What problem does it solve?
This skill guides developers on creating and manipulating Sprite and Image objects in Phaser 4, covering how to use factory methods, textures, frames, and common visual operations.
Core Features & Use Cases
- Factory-based creation of Sprite and Image objects via this.add.sprite and this.add.image, with texture/frame handling.
- Shared component-based APIs for position, scale, rotation, tint, alpha, origin, and depth across both Sprite and Image.
- Texture and frame management via setTexture and setFrame, plus cropping with setCrop and origin adjustments.
- Depth, visibility, and render order controls to manage scene composition and UI layering.
- Real-world scenarios include character rendering, UI elements, and decorative textures in typical 2D game scenes.
Quick Start
In a Scene's create() method, add a Sprite or Image and apply common operations like position, scale, tint, and depth.