cameras

Manage Phaser 4 camera viewports, scrolling, and effects.

Updated Apr 26, 2026
One-click install
npx skills add https://github.com/kehwar/pixi-square --skill cameras-kehwar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cameras
Source: https://github.com/kehwar/pixi-square/tree/main/.agents/skills/cameras
Command: npx skills add https://github.com/kehwar/pixi-square --skill cameras-kehwar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Managing Phaser 4 cameras can be verbose and error-prone, especially with multiple viewports, world scrolling, and a variety of effects.

Core Features & Use Cases

  • Central CameraManager to orchestrate all cameras in a scene and provide a main camera reference
  • Distinction between viewport and world scroll, enabling mini-maps, HUD cameras, and gameplay cameras
  • Rich camera effects: fade, flash, shake, pan, zoomTo, rotateTo, with event hooks
  • Follow targets with configurable lerp, dead zones, and bounds to keep gameplay smooth
  • Multi-camera setups with ignore lists, filters, and per-camera viewport control
  • Broad usage in HUDs, minimaps, cutscenes, and gameplay sequences

Quick Start

In a Phaser scene, access the main camera via this.cameras.main and perform a basic scroll to a point, then start following a target to see the camera move.

Frequently Asked Questions about cameras

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

FAQPage Schema
How do I manage multiple cameras for HUD and minimaps in Phaser 4?

Multi-camera management in Phaser 4 uses a central CameraManager to orchestrate viewports, separating world scroll from viewport projection to render HUDs and minimaps independently. Ignore lists and per-camera viewport control keep UI elements isolated from gameplay views.

How do I apply camera effects like fade, shake, and zoom in Phaser?

Phaser camera effects like fade, flash, shake, pan, zoomTo, and rotateTo are applied through the camera system with configurable event hooks. These visual effects execute directly on target cameras to enhance cutscenes and gameplay sequences.

What is the best way to follow a target with a Phaser 4 camera?

Following a target with a Phaser 4 camera involves configuring lerp values, dead zones, and world bounds. This ensures the camera tracks the sprite smoothly while preventing it from scrolling outside the defined game world.

Does this camera system support deadzones and bounds for scrolling?

Yes, the camera system supports deadzones and bounds for scrolling. Configuring deadzones keeps the target centered within a specified area without moving the camera, while bounds restrict the camera to the game world dimensions.

Why distinguish between viewport and world scroll for multi-camera setups?

Distinguishing viewport and world scroll allows multiple cameras to render different portions of the game world simultaneously. This separation enables dedicated HUD cameras and minimaps to overlay gameplay views without manual coordinate translation.

Can I use camera filters and ignore lists in Phaser 4 scenes?

Yes, multi-camera setups in Phaser 4 support camera filters and ignore lists. Ignore lists prevent specific game objects from rendering on designated cameras, allowing precise control over which elements appear in gameplay views versus UI overlays.