Arraiz
Arraiz

Reputation: 87

about phaser viewports and cameras

Hello for 2 years now I have been developing games mostly using Java`s and libGDX or/and openGL, but now im very interested in Phaser for web-based game development and I think that is a very powerful tool.

I have no problems with game logic but when i come up with render logic in Phaser I need to know if there are possibilities for:

1 Pixel to World unit conversion.

ex: In libGDX I can work in 8x6 world units game instead of using pixels units (640*360 for exmaple) , that helps me to write a lot better logic

2 Multiple cameras in the same scene 1 camera for game and more than one for the HUD .

Upvotes: 0

Views: 744

Answers (1)

James Skemp
James Skemp

Reputation: 8571

  1. It's been a while since I've worked with libGDX, but I think probably the scale manager comes the closest to what you're looking for.

There's a number of tutorials covering how to use it, for example How to Scale a Game for All Device Sizes in Phaser

  1. Last I heard Phaser 3 was going to have support for multiple cameras, but at this point there's a single camera per game. There are ways to do this in Phaser 2.x however, for example this phaser-cameras-example project.

Depending upon what your HUD needs to do, however, there might be a more 'Phaser' way to do it.

Upvotes: 0

Related Questions