cameras

Control Phaser 4 camera behavior for viewport rendering and world navigation.

Updated Feb 11, 2026
One-click install
npx skills add https://github.com/ArtRiv/game-topicos-especiais --skill cameras-artriv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cameras
Source: https://github.com/ArtRiv/game-topicos-especiais/tree/main/skills/cameras
Command: npx skills add https://github.com/ArtRiv/game-topicos-especiais --skill cameras-artriv

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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.

Frequently Asked Questions about cameras

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

FAQPage Schema
How do I make a Phaser camera smoothly follow a player sprite?

Smooth Phaser camera follow is done by calling cam.startFollow(player, false, 0.1, 0.1) on this.cameras.main. The lerp parameters control interpolation, while setDeadzone keeps framing stable during small movements.

How do I set up a minimap and HUD using multiple cameras in Phaser?

Multi-camera minimap and HUD layouts in Phaser use this.cameras to create separate viewports. Apply ignore lists to filter which objects render on specific cameras, cleanly separating UI layers from the main game world.

How do I convert screen pointer coordinates to world coordinates with a scrolled Phaser camera?

Phaser camera scroll and viewport separation requires getWorldPoint to convert screen pointer coordinates to world coordinates. This resolves common issues when navigating large worlds with active zoom and scroll offsets.

Can I constrain camera movement to world bounds and apply zoom in Phaser?

Constrain Phaser camera movement using setBounds(0, 0, worldWidth, worldHeight) and adjust scale with setZoom or zoomTo. Remove constraints later with removeBounds when transitioning between bounded and unbounded areas.

What camera transition effects does Phaser support for scene changes?

Phaser camera transition effects include fade, flash, shake, pan, zoomTo, and rotateTo. Each effect provides event hooks to trigger gameplay logic or scene transitions upon completion.

Why does my Phaser camera show the wrong position when scrolling the world?

Wrong Phaser camera position during scroll happens when confusing viewport placement with world scroll. Manage them independently using scroll, setScroll, and centerOn APIs to properly separate screen rendering from world navigation.