Sign in to follow this  

Phaser 3 HUD Menu

Recommended Posts

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!


Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

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?

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.