What problem does it solve?
This Skill reduces the friction of implementing reliable user input handling in Phaser by giving a single, consistent way to manage keyboard, mouse/pointer, touch, drag-and-drop, and gamepad controls.
Core Features & Use Cases
- Unified Scene Input: Use
this.input to process input events and poll state each frame, including keyboard, pointers, and gamepad.
- Interactive Objects & Hit Areas: Enable input on Game Objects with
setInteractive() and choose default texture hit areas, geometric shapes, or pixel-perfect detection when needed.
- Pointer & Drag Workflows: Support click/hover, multi-touch, pointer lock, and full drag-and-drop pipelines with thresholds, drag events, and drop zones.
- Gamepad Support: Enable gamepad input via
this.input.gamepad, read d-pad/button/analog sticks, and react to connection and button events.
- Use Cases: Building movement controls, menu interaction, clickable UI, touch-friendly interactions, drag-and-drop inventory systems, and controller-based gameplay.
Quick Start
Call setInteractive() on the Game Object you want to respond to, then listen to this.input.on('pointerdown', ...) for scene-wide clicks and sprite.on('pointerdown', ...) for object-specific interactions.