Pular para o conteúdo
Kitbay
Skill

input-keyboard-mouse-touch

MITAtualizado em 21 de ago. de 202640.693Estrelas no GitHub

A skill published in the Phaser repository on handling player input in Phaser 4 games through a scene's input plugin.

O que a skill ensina

A skill published in the Phaser repository on handling player input in Phaser 4 games through a scene's input plugin. It covers keyboard keys created as cursor keys or individual keys, polled each frame or handled through events, with browser capture and key combinations; mouse and touch pointers with their position, button and motion data, right-click and pointer lock; making game objects interactive with texture, shape or pixel-perfect hit areas; drag and drop with drop zones and thresholds; the three levels at which pointer events fire; and gamepads with buttons, sticks and experimental vibration. It points to a longer reference file and the matching source files in the Phaser codebase.

O que faz

  • Read keyboard input in a Phaser scene
  • Make game objects interactive with hit areas
  • Add drag and drop with drop zones
  • Read gamepad buttons and sticks