Jump to content

Zoom camera but not UI


titmael
 Share

Recommended Posts

Hi,

 

I tried a lot of ways but didn't find a good one (even on the forum didn't find).

 

I have a world with bounds (wider than what my camera can see) and have a mouse listener so when player hit an edge it moves the camera if we are not touching world bounds, that's ok.

 

I have a function to scale the world when user uses his mousewheel, works perfectly.

 

I have some sprites fixedToCamera to get an UI. But when the player zooms in or out, UI scales too, and of course I don't want it to scale. I tried to scale world or camera, I tried to revert the scale on thoses sprites but no success.

 

I really need to scale the world to let the player move around with camera, I need a "real" zoom in/out and let the player continue moving with the camera when zoomed in/out.

 

edit : I hope I don't have to handle it externaly to Phaser (pure js and css) ?!

 

Thx  ;)

Link to comment
Share on other sites

To be a bit more clear my game is about a land. I have a small land at the beggining and will be able to purchase near lands later.

The player can move the camera around his land to see what is available or lately in the game to 'walk' across lands.

 

So if I scale up (zoom in) a group of sprites, I think I won't be able to move to my game edges no ? Sprites will be bigger but my world not. I don't know if I'm right or not

Link to comment
Share on other sites

  • 3 months later...
 Share

  • Recently Browsing   0 members

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