Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Payotz | |
Old Version | Published before Godot 3 was released. |
I’m having trouble understanding the behavior of Camera2D.set_zoom().
Basically I have two rooms that are different in sizes. The second room is larger than my resolution, so in order to render the whole thing, There is a “Player Node” inside the first room that have a Camera2D inside of it. The second room has a Camera2D in itself.
Room1 _ready():
get_node("Player/Camera2D").make_current()
Room2 _ready():
get_node("Camera2D").make_current()
get_node("Camera2D").set_zoom(Vector2(0.5,0.5))
My default scene is Room1.
So when I first loaded the game, everything is good:
And when I loaded Room2, it rendered everything perfectly:
Then when I came back to Room1:
As you can see, it’s really zoomed in without me doing anything. I’ve also tried get_node(“Player/Camera2D”).make_current() in _fixed_process(delta):
The only thing that I discovered is set_zoom(Vector2(-1,-1)) makes it inverted.
And set_zoom(Vector2(x,x)) [where x > 1] zooms it out even more
Question:
What does zoom do exactly? And how can I return Room1 into the “normal” zoom?
Also, why does setting zoom on one Camera affect the other?