Describe the project you are working on
Allowing the user to use the scroll wheel to zoom in and out of the map.
Describe the problem or limitation you are having in your project
When adjusting a Camera2D's zoom property, the values are inverted:
The camera's zoom relative to the viewport. Values larger than Vector2(1, 1) zoom out and smaller values zoom in. For an example, use Vector2(0.5, 0.5) for a 2× zoom-in, and Vector2(4, 4) for a 4× zoom-out.
Currrently a zoom of Vector(2, 2) halves the size of objects in the viewport. Similarly, a zoom of Vector(0.5, 0.5) doubles the size of objects in the viewport:
| No Zoom |
Zoom: (2, 2) |
Zoom: (0.5, 0.5) |
 |
 |
 |
Describe the feature / enhancement and how it helps to overcome the problem or limitation
I would expect values greater than 1 to increase the zoom and values less than 1 to decrease the zoom. A zoom of Vector(2, 2) should double the size seen in the viewport. Similarly, a zoom of Vector(0.5, 0.5) should halve the size seen in the viewport:
| No Zoom |
Zoom: (2, 2) |
Zoom: (0.5, 0.5) |
 |
 |
 |
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
This would be a case of simply inverting the values inside the engine.
See godotengine/godot#57392
If this enhancement will not be used often, can it be worked around with a few lines of script?
Yes, but this is what I want to avoid.
Is there a reason why this should be core and not an add-on in the asset library?
It's how the engine treats Camera2D's zoom property.
Describe the project you are working on
Allowing the user to use the scroll wheel to zoom in and out of the map.
Describe the problem or limitation you are having in your project
When adjusting a
Camera2D'szoomproperty, the values are inverted:Currrently a zoom of
Vector(2, 2)halves the size of objects in the viewport. Similarly, a zoom ofVector(0.5, 0.5)doubles the size of objects in the viewport:Describe the feature / enhancement and how it helps to overcome the problem or limitation
I would expect values greater than 1 to increase the zoom and values less than 1 to decrease the zoom. A zoom of
Vector(2, 2)should double the size seen in the viewport. Similarly, a zoom ofVector(0.5, 0.5)should halve the size seen in the viewport:Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
This would be a case of simply inverting the values inside the engine.
See godotengine/godot#57392
If this enhancement will not be used often, can it be worked around with a few lines of script?
Yes, but this is what I want to avoid.
Is there a reason why this should be core and not an add-on in the asset library?
It's how the engine treats
Camera2D'szoomproperty.