-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Improve usability of Camera2D
#101427
base: master
Are you sure you want to change the base?
Improve usability of Camera2D
#101427
Conversation
While I like the idea of making editing the camera limits a more interactive experience, I very much dislike the change of the default limit. I didn't try it out, but wouldn't this effectively make a camera that gets added to a node non-functional (as in, it doesn't move in any direction) unless you enlarge the limit rectangle? This would be a bad user experience, and lead to lots of confusion. Edit: This is also why the unit tests fail. Instead, I propose a Boolean property on the camera to enable/disable the limits, and have it disabled by default. |
Good idea, but the reason why I changed the default is that users couldn't see and drag the rectangle as it was too large to find the dragger if we still use default 1000000 rectangle, unless they change the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Now the default limit will not be +/-1000000, instead, the top-left will be (0, 0) while the bottom-right will become (viewport_w, viewport_h)
This is compatibility breaking change. Properties set to their default values are not being saved to the resource (scene) file, meaning if someone was using Camera2D with its default limits unchanged, then such limits are not saved within the scene file containing the Camera2D. After this change loading such scene would create the Camera2D with the new defaults, resulting in changed behavior (likely breaking user's project).
Camera2D
51572e1
to
908a392
Compare
I reverted the change of default value. What takes the place of the previous change has been added in the top post. |
Oh, haven't thought about that new bool suggestion previously, but
So the limits should be enabled by default to preserve the current behavior. Regarding the |
…it to `false` by default
8ff4594
to
cfeca3b
Compare
Implements and closes: godotengine/godot-proposals#11527
Changes:
* Now the default limit will not be +/-1000000, instead, the top-left will be (0, 0) while the bottom-right will become (viewport_w, viewport_h)limit_disabled
, which allows the camera focus to move anywhere. Set tofalse
by default.Snap Limit to Viewport
, on which you click will snap the top-left limit to the global position of the camera and the bottom-right limit to the global position plus the size of the viewport.editor_draw_limits_color
, which allows you to change the color of the limit rect.limit_*
variables.Issues