summaryrefslogtreecommitdiff
path: root/scene/2d/camera_2d.cpp
diff options
context:
space:
mode:
authorMicky <micheledevita2@gmail.com>2022-08-13 13:37:10 +0200
committerMicky <micheledevita2@gmail.com>2022-09-21 01:52:12 +0200
commitee16de583fef6673937bba3cd51cbf16cf5527ea (patch)
tree949e1c89a814d0f8c032d6b938b5d145b6c6ad81 /scene/2d/camera_2d.cpp
parent658bfb0395fa356f67745de0620628167671d5c6 (diff)
Reverse Camera2D.`rotating` to `ignore_rotation`
`rotating` is misleading, as Camera2D is affected by `rotation` and `global_rotation` like any other Node2D Updates description in the docs, as well.
Diffstat (limited to 'scene/2d/camera_2d.cpp')
-rw-r--r--scene/2d/camera_2d.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index a11b2b66bf..e120aa871b 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -172,7 +172,7 @@ Transform2D Camera2D::get_camera_transform() {
Point2 screen_offset = (anchor_mode == ANCHOR_MODE_DRAG_CENTER ? (screen_size * 0.5 * zoom_scale) : Point2());
real_t angle = get_global_rotation();
- if (rotating) {
+ if (!ignore_rotation) {
screen_offset = screen_offset.rotated(angle);
}
@@ -204,7 +204,7 @@ Transform2D Camera2D::get_camera_transform() {
Transform2D xform;
xform.scale_basis(zoom_scale);
- if (rotating) {
+ if (!ignore_rotation) {
xform.set_rotation(angle);
}
xform.set_origin(screen_rect.position);
@@ -363,15 +363,15 @@ Camera2D::AnchorMode Camera2D::get_anchor_mode() const {
return anchor_mode;
}
-void Camera2D::set_rotating(bool p_rotating) {
- rotating = p_rotating;
+void Camera2D::set_ignore_rotation(bool p_ignore) {
+ ignore_rotation = p_ignore;
Point2 old_smoothed_camera_pos = smoothed_camera_pos;
_update_scroll();
smoothed_camera_pos = old_smoothed_camera_pos;
}
-bool Camera2D::is_rotating() const {
- return rotating;
+bool Camera2D::is_ignoring_rotation() const {
+ return ignore_rotation;
}
void Camera2D::set_process_callback(Camera2DProcessCallback p_mode) {
@@ -668,8 +668,8 @@ void Camera2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_anchor_mode", "anchor_mode"), &Camera2D::set_anchor_mode);
ClassDB::bind_method(D_METHOD("get_anchor_mode"), &Camera2D::get_anchor_mode);
- ClassDB::bind_method(D_METHOD("set_rotating", "rotating"), &Camera2D::set_rotating);
- ClassDB::bind_method(D_METHOD("is_rotating"), &Camera2D::is_rotating);
+ ClassDB::bind_method(D_METHOD("set_ignore_rotation", "ignore"), &Camera2D::set_ignore_rotation);
+ ClassDB::bind_method(D_METHOD("is_ignoring_rotation"), &Camera2D::is_ignoring_rotation);
ClassDB::bind_method(D_METHOD("_update_scroll"), &Camera2D::_update_scroll);
@@ -733,7 +733,7 @@ void Camera2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset", PROPERTY_HINT_NONE, "suffix:px"), "set_offset", "get_offset");
ADD_PROPERTY(PropertyInfo(Variant::INT, "anchor_mode", PROPERTY_HINT_ENUM, "Fixed TopLeft,Drag Center"), "set_anchor_mode", "get_anchor_mode");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rotating"), "set_rotating", "is_rotating");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ignore_rotation"), "set_ignore_rotation", "is_ignoring_rotation");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "current"), "set_current", "is_current");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "zoom", PROPERTY_HINT_LINK), "set_zoom", "get_zoom");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_viewport", PROPERTY_HINT_RESOURCE_TYPE, "Viewport", PROPERTY_USAGE_NONE), "set_custom_viewport", "get_custom_viewport");