scale-and-responsive

Configures Phaser 4 ScaleManager for responsive scaling, centering, fullscreen, and orientation handling.

2|10|Updated Jul 28, 2026
One-click install
npx skills add https://github.com/kodingvibes/gamejam-2026 --skill scale-and-responsive-kodingvibes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scale-and-responsive
Source: https://github.com/kodingvibes/gamejam-2026/tree/main/participantes/jpyunism/.agents/skills/scale-and-responsive
Command: npx skills add https://github.com/kodingvibes/gamejam-2026 --skill scale-and-responsive-kodingvibes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Phaser games often break visually when the browser window resizes, the device rotates, or the game runs on screens of different sizes. This Skill provides the exact ScaleManager configuration patterns, scale modes, and event handling needed to make a Phaser 4 game adapt correctly to any display. ## Core Features & Use Cases - Scale Modes: Configure FIT, RESIZE, ENVELOP, EXPAND, and NONE modes with auto-centering, zoom, snap values, and min/max constraints. - Fullscreen & Orientation: Implement fullscreen toggles triggered from pointerup gestures and respond to device orientation changes on mobile. - Resize Events: Listen to the resize event to reposition cameras and UI elements dynamically when the canvas size changes. - Use Case: You are building a pixel-art game at 320x240 resolution. Use FIT mode with MAX_ZOOM and pixelArt enabled so the game scales to the largest crisp integer zoom that fits the player's screen. ## Quick Start Ask the AI to make your Phaser game responsive by configuring the scale object with FIT mode and CENTER_BOTH auto-centering.

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 game responsive to window resizing?▼

Set the scale mode to Phaser.Scale.RESIZE with width and height as '100%' so the canvas fills its parent. Then listen to the scale 'resize' event in your scene to reposition cameras and UI elements when dimensions change.

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

FIT scales the canvas via CSS to fit inside the parent while preserving aspect ratio, possibly leaving letterbox bars. RESIZE changes the actual canvas dimensions to match the parent with 1:1 pixel mapping, which can affect GPU fill-rate on large displays.

How do I enable fullscreen in a Phaser game?▼

Call this.scale.startFullscreen() or this.scale.toggleFullscreen() from a pointerup input handler, not pointerdown, since browsers block fullscreen requests from pointerdown on touch devices. For iframes, the allowfullscreen attribute is required.

Why is my Phaser game not centering on the page?▼

Auto-centering fails when the parent element has no calculable dimensions. Give the parent explicit CSS width and height, or rely on the default expandParent: true option which sets the parent or body height to 100%.

How do I scale a pixel art game without blurring in Phaser?▼

Use FIT mode with zoom set to Phaser.Scale.MAX_ZOOM and set pixelArt: true in the game config. MAX_ZOOM picks the largest integer multiplier fitting the parent, and pixelArt disables anti-aliasing for crisp rendering.

When should I use resize() versus setGameSize() in Phaser?▼

Use resize() only in NONE scale mode, where it sets game, base, and display sizes directly. Use setGameSize() with scaled modes like FIT or ENVELOP, since it changes the base game size while preserving the scale mode calculations.