Jump to content

zoom to fit


systemlord01
 Share

Recommended Posts

Hi,

I am playing around with the camera. Basicly i have huge map and when a player clicks on an item on the map i want the camera to zoom in and fit a certain area (lets call it a rectangle).

I had solve this problem in previous project in paper.js with some very complex calculations. But it is not easy because the camera needs to recenter while it moves and also you need to calculate zoom level that would fit the given area.

Also depending on the zoom level you are currently at, the zoom speed should be different.

Is there an easy way to do this in phaser 3?

 

I have already implemented a custom way for zooming with the mouse. I got it to be pretty smooth but not as smooth as with the SmoothedControlConfig using the keys (that doesnt support mouse for some reason :( ). Is there any work planned for this?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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