scale-and-responsive

Configure Phaser 4 ScaleManager scale modes and auto-centering for responsive games.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/jallard-007/jallard-ca-server --skill scale-and-responsive-jallard-007
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scale-and-responsive
Source: https://github.com/jallard-007/jallard-ca-server/tree/main/.github/skills/scale-and-responsive
Command: npx skills add https://github.com/jallard-007/jallard-ca-server --skill scale-and-responsive-jallard-007

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Phaser 4 games often struggle to adapt to varying screen sizes and orientations, leading to inconsistent visuals and interaction areas across devices.

Core Features & Use Cases

  • Configure scale modes (FIT, RESIZE, ENVELOP, EXPAND) to maintain aspect ratio or fill available space.
  • Auto-center canvases and manage fullscreen toggling and orientation changes for a smooth, responsive experience.
  • Respond to browser resize events to adjust cameras, UI layout, and game elements in real time.

Quick Start

Configure your game with a responsive scale setup (e.g., mode: Phaser.Scale.FIT and autoCenter) and handle resize and fullscreen events to adapt the layout.

Frequently Asked Questions about scale-and-responsive

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

FAQPage Schema
How do I make a Phaser 4 game responsive to different screen sizes?

Make a Phaser 4 game responsive by configuring the ScaleManager with scale modes like FIT or RESIZE, enabling auto-centering, and attaching resize listeners to adjust cameras and UI layout in real time.

What is the difference between FIT, RESIZE, and EXPAND scale modes in Phaser?

FIT maintains the aspect ratio by adding margins, RESIZE dynamically alters the game canvas dimensions, and EXPAND fills available space without preserving the original aspect ratio in Phaser.

How do I auto-center a Phaser game canvas and handle fullscreen toggling?

Auto-center a Phaser canvas by configuring the autoCenter property within the ScaleManager, and handle fullscreen toggling by listening to and managing fullscreen events for a responsive experience.

Does the Phaser ScaleManager support orientation changes for mobile web games?

Yes, the Phaser ScaleManager supports orientation handling for mobile web games, allowing developers to detect screen orientation shifts and adapt the game layout accordingly.

What is the best way to adjust UI layout when the browser resizes a Phaser game?

The best way to adjust UI layout on browser resize is to attach resize listeners to the ScaleManager events, enabling real-time updates to game elements and cameras as screen dimensions change.

Why does my Phaser 4 game not fill the embedded canvas correctly?

A Phaser 4 game may not fill an embedded canvas correctly due to using the wrong scale mode, requiring a switch to ENVELOP or EXPAND, or adjusting autoCenter properties to fit the container.