Viewport.content_scale_factor and camera zoom interaction #589
Unanswered
hatmix
asked this question in
Question / Help Wanted
Replies: 0 comments
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.
-
My current project includes UI scaling using the content_scale_factor, mostly as suggested in Godot's multiple resolutions example project. In 2D, this requires the camera to apply the scale's inverse to zoom to keep the same view of the gameplay area while the HUD size is changed. When I used Camera2D, I just added a target_zoom property, hooked the right signals and recalculated camera zoom whenever target_zoom or content_scale_factor changed.
I'm wanting to move to PhantomCamera and looking for the best way (or a good way) to manage this with pcam. Should I extend PhantomCamera2D to do the same thing with a target_zoom property? Or is there a better way? TIA!
Beta Was this translation helpful? Give feedback.
All reactions