summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-01-08 19:31:50 +0100
committerGitHub <noreply@github.com>2018-01-08 19:31:50 +0100
commit05297d8b391c20d96f155b45347dd093fd6f26d9 (patch)
tree5b2a8b52e50046f2bd9a1e08c1eaab2081f1ee7c
parentefe27c6ed243bfa559a94be957c479d8e1025ba2 (diff)
parentd4adcf3fa26a032ba36c38c3d1ec5e8d02a5f09c (diff)
Merge pull request #15060 from poke1024/camera2d-update
Update Camera2D scroll using NOTIFICATION_INTERNAL_PROCESS
-rw-r--r--scene/2d/camera_2d.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index 0a6d80d49c..006347d30a 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -143,7 +143,7 @@ Transform2D Camera2D::get_camera_transform() {
if (smoothing_enabled && !Engine::get_singleton()->is_editor_hint()) {
- float c = smoothing * get_physics_process_delta_time();
+ float c = smoothing * get_process_delta_time();
smoothed_camera_pos = ((camera_pos - smoothed_camera_pos) * c) + smoothed_camera_pos;
ret_camera_pos = smoothed_camera_pos;
//camera_pos=camera_pos*(1.0-smoothing)+new_camera_pos*smoothing;
@@ -217,14 +217,14 @@ void Camera2D::_notification(int p_what) {
switch (p_what) {
- case NOTIFICATION_PHYSICS_PROCESS: {
+ case NOTIFICATION_INTERNAL_PROCESS: {
_update_scroll();
} break;
case NOTIFICATION_TRANSFORM_CHANGED: {
- if (!is_physics_processing())
+ if (!is_processing_internal())
_update_scroll();
} break;
@@ -246,7 +246,7 @@ void Camera2D::_notification(int p_what) {
add_to_group(canvas_group_name);
if (Engine::get_singleton()->is_editor_hint()) {
- set_physics_process(false);
+ set_process_internal(false);
}
_update_scroll();
@@ -503,9 +503,9 @@ void Camera2D::set_follow_smoothing(float p_speed) {
smoothing = p_speed;
if (smoothing > 0 && !(is_inside_tree() && Engine::get_singleton()->is_editor_hint()))
- set_physics_process(true);
+ set_process_internal(true);
else
- set_physics_process(false);
+ set_process_internal(false);
}
float Camera2D::get_follow_smoothing() const {