Pular para o conteúdo
Kitbay
Skill

cameras

MITAtualizado em 21 de ago. de 202640.693Estrelas no GitHub

A reference skill in the Phaser repository for working with cameras in Phaser 4, the HTML5 game framework.

O que a skill ensina

A reference skill in the Phaser repository for working with cameras in Phaser 4, the HTML5 game framework. It explains the camera manager and main camera, the difference between a camera's viewport on the canvas and its scroll position in the world, zoom limits and scroll bounds, and following a sprite with smoothing, offsets and dead zones. Common patterns cover minimaps, fixed HUD cameras and ignore lists, effects such as fade, flash, shake, pan, zoom and rotate, keyboard camera controls, converting pointer positions to world coordinates, and the WebGL-only camera filters new in version 4. It also lists camera events and points to related skills and a longer reference file.

O que faz

  • Follow sprites with smoothing and dead zones
  • Add minimap and HUD cameras
  • Apply fade, shake and zoom effects
  • Convert pointer positions to world coordinates