yigitozdemir Posted June 3, 2018 Share Posted June 3, 2018 Hi everyone, I am trying to move Phaser 3 and building a demo project that includes HUD menu. In Phaser 2, i was using sprite.fixedToCamera but i couldn't find a property that equals to fixedToCamera in docs. Is there a proper solution to implement HUD menus that won't be affected from main camera's zoom ratio? Thank you! Yiğit. Link to comment Share on other sites More sharing options...
prob Posted June 4, 2018 Share Posted June 4, 2018 With Phaser 3, you can create a HUD/UI overlay with a scene that is active at the same time as your main game scene (or scenes). Every scene has its own set of inputs, game objects, cameras and more; so the camera setup in one scene is totally separate from every other scene. You can start/restart/stop/pause and change the render order (the scene layering or depth) with the Scene Manager. Link to comment Share on other sites More sharing options...
B3L7 Posted June 4, 2018 Share Posted June 4, 2018 To add on to what prob is saying you will want to apply .setScrollFactor(0) to each game object in the HUD scene. That is the phaser 3 equivelant to fixed to camera. To get an idea of a HUD scene take a look at: https://labs.phaser.io/edit.html?src=src\scenes\ui scene es6.js eddieone 1 Link to comment Share on other sites More sharing options...
yigitozdemir Posted June 5, 2018 Author Share Posted June 5, 2018 Thank you for answers, both of suggested solutions work for me now B3L7 1 Link to comment Share on other sites More sharing options...
Andrew Chen Posted December 1, 2018 Share Posted December 1, 2018 scoreText.setScrollFactor(0); enriqueto 1 Link to comment Share on other sites More sharing options...
aylictal Posted February 14, 2019 Share Posted February 14, 2019 Sorry to bump and old thread, this idea is working great for me but I have one problem. Pretend that instead of a set text call like in the example it was a fillRect instead. This still works fine until a user does something like resizes the window, then the fillrect starts painting all over the main scene. How can you trigger a repaint of the main scene in case of a resize? Link to comment Share on other sites More sharing options...
iom Posted November 19, 2019 Share Posted November 19, 2019 I can't get ` .setScrollFactor(0)` to stop any object from resizing on zoom and I can't get two concurrent scenes running... Link to comment Share on other sites More sharing options...
Recommended Posts