Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invert Camera2D zoom to make it intuitive #57392

Merged
merged 1 commit into from
Mar 14, 2022

Conversation

madmiraal
Copy link
Contributor

@madmiraal madmiraal commented Jan 29, 2022

As explained in godotengine/godot-proposals#3888, currently, Camera2D's zoom property values are inverted:

No Zoom Zoom: (2, 2) Zoom: (0.5, 0.5)
Zoom x1 - Current Zoom x2 - Current Zoom x0 5 - Current

This PR uses the inverted zoom values to scale objects in the viewport as expected i.e. a zoom of Vector(2, 2) doubles the size seen in the viewport, and a zoom of Vector(0.5, 0.5) halves the size seen in the viewport:

No Zoom Zoom: (2, 2) Zoom: (0.5, 0.5)
Zoom x1 - Current Zoom x0 5 - Current Zoom x2 - Current

Closes godotengine/godot-proposals#3888.
Supersedes #55731

@madmiraal madmiraal requested review from a team as code owners January 29, 2022 09:34
@Chaosus Chaosus changed the title Invert Camear2D zoom to make it intuitive Invert Camera2D zoom to make it intuitive Jan 29, 2022
@Chaosus Chaosus added this to the 4.0 milestone Jan 29, 2022
@KoBeWi
Copy link
Member

KoBeWi commented Jan 29, 2022

#55731...

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks and works good.

@KoBeWi KoBeWi mentioned this pull request Mar 13, 2022
@akien-mga akien-mga merged commit b7bc8db into godotengine:master Mar 14, 2022
@akien-mga
Copy link
Member

Thanks!

@madmiraal madmiraal deleted the implement-3888 branch March 14, 2022 11:20
MitchMakesThings added a commit to MitchMakesThings/Godot-Things that referenced this pull request Jul 6, 2022
This fixes a crash on startup caused by the new Alpha ignoring old replication configs.
Also flipped the camera zoom to match the new camera zoom direction (godotengine/godot#57392 - added in Alpha 5!)
Resolves #3
Mickeon added a commit to Mickeon/godot that referenced this pull request Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invert Camera2D zoom values to make it intuitive
4 participants