What problem does it solve?
This skill helps you control what players see by configuring Phaser 4 cameras for scrolling worlds, zooming, following targets, and applying cinematic camera effects without fighting coordinate systems.
Core Features & Use Cases
- Viewport and world control: Distinguish and use viewport positioning (where the camera renders on the screen) versus scroll (what part of the world is shown).
- Target tracking: Follow sprites with optional smoothing (lerp) and deadzones for stable framing.
- Cinematic camera effects: Shake, fade, flash, pan, zoomTo, and rotateTo with event hooks and reset functionality.
- Multi-camera setups: Create multiple cameras (e.g., minimap + HUD camera) and use ignore lists to control what each camera renders.
Quick Start
Use the scene's create() method to configure the main camera with scrolling, follow, zoom, bounds, and an effect like shake so the view stays centered and dynamic during gameplay.