scale-and-responsive

Automate responsive scaling and centering for Phaser 4 games.

Updated Jun 23, 2026
One-click install
npx skills add https://github.com/Joshua-Allen/stake-engine-game-dev --skill scale-and-responsive-joshua-allen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scale-and-responsive
Source: https://github.com/Joshua-Allen/stake-engine-game-dev/tree/main/skills/scale-and-responsive
Command: npx skills add https://github.com/Joshua-Allen/stake-engine-game-dev --skill scale-and-responsive-joshua-allen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of making Phaser 4 games responsive and handling display scaling, ensuring a consistent experience across different devices and screen sizes.

Core Features & Use Cases

  • Responsive Scaling: Adapts game size and scaling mode to fit any screen size while maintaining aspect ratio.
  • Scale Modes: Offers various scale modes like FIT, RESIZE, EXPAND, and ENVELOP to suit different design requirements.
  • Centering: Provides options for centering the game within the screen.
  • Fullscreen and Resize Handling: Manages fullscreen transitions and browser window resize events.
  • Use Case: A game developer uses this Skill to create a responsive game that looks great on mobile, tablet, and desktop devices.

Quick Start

Use the scale-and-responsive skill to set up responsive scaling for your Phaser 4 game with the following configuration:

const config = {
    type: Phaser.AUTO,
    scale: {
        parent: 'game-container',
        mode: Phaser.Scale.FIT,
        autoCenter: Phaser.Scale.CENTER_BOTH,
        width: 800,
        height: 600
    },
    scene: MyScene
};
const game = new Phaser.Game(config);

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 across different screen sizes?

You can make a Phaser 4 game responsive by configuring the ScaleManager to handle window resize events and fullscreen transitions, ensuring the display adapts dynamically to any screen size while preserving the aspect ratio.

What scale modes does Phaser 4 support for responsive game scaling?

Phaser 4 responsive scaling supports FIT, RESIZE, EXPAND, and ENVELOP modes, allowing you to control how the game canvas adapts its dimensions and aspect ratio to fit various browser windows.

How do I center a Phaser game in the browser window?

You center a Phaser game in the browser window by applying centering options within the scale configuration, such as using the CENTER_BOTH constant to automatically align the game canvas.

Does Phaser 4 handle browser window resize events automatically?

Yes, responsive scaling in Phaser 4 handles browser window resize events automatically by utilizing the ScaleManager to dynamically adjust the game canvas without losing the aspect ratio.

What is the best way to handle fullscreen transitions in a Phaser game?

The best way to handle fullscreen transitions in a Phaser game is to use the ScaleManager for dynamic scaling, which automatically manages display changes and maintains the aspect ratio during transitions.