What problem does it solve?
This skill helps you reliably control a Phaser 4 scene camera so your game view can follow targets, move through the world, and deliver cinematic effects without confusing viewport versus world coordinates.
Core Features & Use Cases
- Camera positioning & world tracking: Manage viewport placement and world scroll independently using APIs like scroll, setScroll, centerOn, and getWorldPoint for pointer-to-world conversions.
- Zoom, bounds, and deadzones: Constrain camera movement with setBounds and removeBounds, adjust scale with setZoom and zoomTo, and keep framing stable using setDeadzone while following.
- Effects and multi-camera setups: Apply fade/flash/shake/pan/rotateTo effects, wire up follow behavior, and configure multiple cameras (including ignore lists) for minimaps and HUD layers.
- When to use: Use it when building side-scrollers, top-down games, minimap HUDs, smooth camera follow systems, or when you need transitions like fade/flash plus camera motion effects.
Quick Start
Use the cameras skill in your Phaser 4 Scene by getting this.cameras.main and then calling cam.startFollow(player, false, 0.1, 0.1) to smoothly track your target while using cam.setZoom(2) and cam.setBounds(0, 0, worldWidth, worldHeight) to frame the world correctly.