Standard way to zoom in torwards mouse #668
Unanswered
ThiagoBastosN
asked this question in
Question / Help Wanted
Replies: 1 comment 2 replies
Correct, because the position is being set on every frame when a I have some ideas what you could try, but wondering if you could describe the use case / flow a bit further? |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello! I am currently using PhantomCamera for a 2D project.
I would like to know what is the recommended approach when it comes to zooming in the camera torwards the mouse cursor in two situations:
NoneCurrently I am using the setter
set_zoomwith a tween in order to make a smooth zooming effect and I zoom in/out with the mouse wheel.I am using a variation of this logic to apply the correction on the camera to maintain the mouse cursor on the same position after the zoom takes effect:
But I guess changing the PhantomCamera2D position directly when it is following a target is not the best approach. I had some trouble with it.
Is there a standard way to achieve the expected behavior when using PhantomCamera?
All reactions