Jump to content

Disable camera zooming for specific group


Recommended Posts

Hi everyone!

I have the following problem.

I have several groups in my game: backgrounds, foregrounds, game objects, etc..

One of those groups is GUI group.

When the camera is zooming all the groups are zooming too.

Is there a way not to zoom this specific (GUI) group on camera zooming?

I tried to set fixedToCamera property, but it doesn't seem to consider zooming.


Link to comment
Share on other sites

The way I'd do this is to create two separate groups at the root of the display list, one for the UI and another for everything else which would scale/zoom, and then only scale the second group to produce the zoom effect. This way, because the UI group separate from the other group, it won't move or scale when the other does.

Link to comment
Share on other sites

Just to elaborate, this means you're scaling the group, not the camera - this will unfortunately introduce more work as you'll have to replicate the effects of the camera with a moving and scaling group... I think probably it may be easier in your case actually to take a look at what happens inside Phaser when you set fixedToCamera to true, and try to add in the scaling fix.

Link to comment
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.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...