Phaser input and scaling
Keeps taps and clicks aligned with the game world as the canvas and camera change. It also clears held controls when focus is lost or a menu takes over.
phaser-input-scale
See how it helpsWhen is it useful?
Use when touch targets move incorrectly after resizing or input leaks through the HUD.
What does it help you do?
- Maps keyboard, touch and controller events to explicit actions.
- Converts coordinates through camera and world scale rather than CSS stretching.
- Resets held input during focus loss, pause and scene transitions.
Try asking this
In our tower-defense game, place a tower by tapping a grid cell on a phone. Rotate the screen, move the camera and open the shop. Placement must match the selected cell, shop taps must not build towers, and returning from another tab must clear held movement.
Detailed documentation
Read the skill’s original instructions, examples and checks in their authored language.
Show less
Phaser — input scale
Use when implementing Phaser touch, keyboard, gamepad or responsive canvas interaction.
Version and project gate
Inspect Phaser major version, package lock, scene registry, renderer, scale configuration, Arcade/Matter plugins, loaders, animation keys and deployment base path. Phaser 2 States, Phaser 3 Scenes and newer APIs are not interchangeable. Never turn a task into an engine upgrade without the user’s intent. Read the version-matching official reference when an API decision depends on it.
Work
Map device input to actions and define UI/gameplay capture. Choose scale and camera behavior for the game’s target orientation. Convert pointer positions through the relevant camera and world transform; reset held input on focus loss and scene transitions.
Deliver
An input/scale contract with working menu and play interactions on the intended aspect ratios. Keep the change in the existing project structure; separate actual observations from the proposed acceptance scenario below.
Failure to prevent
CSS stretching alone can misalign hit areas and canvas coordinates.
Acceptance scenario
Tap screen edges, resize the host, hold a key during pause and interact with a HUD overlay above gameplay. Follow the project’s execution and verification permissions. If execution or a target device is unavailable, provide the reproduction steps and name the remaining uncertainty; do not mark it passed.
Scope and sources
This skill belongs to Kip. Agent selection is restricted by Orqestria’s assigned-agent policy, including forced skill selection; instruction text alone is not an access control. These are original task workflows researched from official documentation, not a copied or endorsed vendor skill.
Included files 1
SKILL.md
