summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/audio_stream_player_2d.cpp5
-rw-r--r--scene/2d/camera_2d.cpp14
-rw-r--r--scene/2d/collision_polygon_2d.cpp5
-rw-r--r--scene/2d/collision_shape_2d.cpp6
-rw-r--r--scene/2d/joints_2d.cpp8
-rw-r--r--scene/2d/light_2d.cpp4
-rw-r--r--scene/2d/light_occluder_2d.cpp4
-rw-r--r--scene/2d/navigation_polygon.cpp7
-rw-r--r--scene/2d/parallax_layer.cpp4
-rw-r--r--scene/2d/particles_2d.cpp3
-rw-r--r--scene/2d/path_2d.cpp6
-rw-r--r--scene/2d/physics_body_2d.cpp6
-rw-r--r--scene/2d/position_2d.cpp4
-rw-r--r--scene/2d/ray_cast_2d.cpp10
-rw-r--r--scene/2d/screen_button.cpp10
-rw-r--r--scene/2d/visibility_notifier_2d.cpp14
16 files changed, 67 insertions, 43 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp
index 1423a804ff..73782e1515 100644
--- a/scene/2d/audio_stream_player_2d.cpp
+++ b/scene/2d/audio_stream_player_2d.cpp
@@ -1,7 +1,10 @@
#include "audio_stream_player_2d.h"
+
+#include "engine.h"
#include "scene/2d/area_2d.h"
#include "scene/main/viewport.h"
+
void AudioStreamPlayer2D::_mix_audio() {
if (!stream_playback.is_valid()) {
@@ -120,7 +123,7 @@ void AudioStreamPlayer2D::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
AudioServer::get_singleton()->add_callback(_mix_audios, this);
- if (autoplay && !get_tree()->is_editor_hint()) {
+ if (autoplay && !Engine::get_singleton()->is_editor_hint()) {
play();
}
}
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index 20571abdb9..07c3099a72 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -38,7 +38,7 @@ void Camera2D::_update_scroll() {
if (!is_inside_tree())
return;
- if (get_tree()->is_editor_hint()) {
+ if (Engine::get_singleton()->is_editor_hint()) {
update(); //will just be drawn
return;
}
@@ -85,7 +85,7 @@ Transform2D Camera2D::get_camera_transform() {
if (anchor_mode == ANCHOR_MODE_DRAG_CENTER) {
- if (h_drag_enabled && !get_tree()->is_editor_hint()) {
+ if (h_drag_enabled && !Engine::get_singleton()->is_editor_hint()) {
camera_pos.x = MIN(camera_pos.x, (new_camera_pos.x + screen_size.x * 0.5 * drag_margin[MARGIN_RIGHT]));
camera_pos.x = MAX(camera_pos.x, (new_camera_pos.x - screen_size.x * 0.5 * drag_margin[MARGIN_LEFT]));
} else {
@@ -97,7 +97,7 @@ Transform2D Camera2D::get_camera_transform() {
}
}
- if (v_drag_enabled && !get_tree()->is_editor_hint()) {
+ if (v_drag_enabled && !Engine::get_singleton()->is_editor_hint()) {
camera_pos.y = MIN(camera_pos.y, (new_camera_pos.y + screen_size.y * 0.5 * drag_margin[MARGIN_BOTTOM]));
camera_pos.y = MAX(camera_pos.y, (new_camera_pos.y - screen_size.y * 0.5 * drag_margin[MARGIN_TOP]));
@@ -136,7 +136,7 @@ Transform2D Camera2D::get_camera_transform() {
camera_pos.y -= screen_rect.position.y - limit[MARGIN_TOP];
}
- if (smoothing_enabled && !get_tree()->is_editor_hint()) {
+ if (smoothing_enabled && !Engine::get_singleton()->is_editor_hint()) {
float c = smoothing * get_fixed_process_delta_time();
smoothed_camera_pos = ((camera_pos - smoothed_camera_pos) * c) + smoothed_camera_pos;
@@ -240,7 +240,7 @@ void Camera2D::_notification(int p_what) {
add_to_group(group_name);
add_to_group(canvas_group_name);
- if (get_tree()->is_editor_hint()) {
+ if (Engine::get_singleton()->is_editor_hint()) {
set_fixed_process(false);
}
@@ -262,7 +262,7 @@ void Camera2D::_notification(int p_what) {
} break;
case NOTIFICATION_DRAW: {
- if (!is_inside_tree() || !get_tree()->is_editor_hint())
+ if (!is_inside_tree() || !Engine::get_singleton()->is_editor_hint())
break;
if (screen_drawing_enabled) {
@@ -497,7 +497,7 @@ void Camera2D::align() {
void Camera2D::set_follow_smoothing(float p_speed) {
smoothing = p_speed;
- if (smoothing > 0 && !(is_inside_tree() && get_tree()->is_editor_hint()))
+ if (smoothing > 0 && !(is_inside_tree() && Engine::get_singleton()->is_editor_hint()))
set_fixed_process(true);
else
set_fixed_process(false);
diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp
index bd669eb4c8..433661e393 100644
--- a/scene/2d/collision_polygon_2d.cpp
+++ b/scene/2d/collision_polygon_2d.cpp
@@ -30,6 +30,7 @@
#include "collision_polygon_2d.h"
#include "collision_object_2d.h"
+#include "engine.h"
#include "scene/resources/concave_polygon_shape_2d.h"
#include "scene/resources/convex_polygon_shape_2d.h"
@@ -134,7 +135,7 @@ void CollisionPolygon2D::_notification(int p_what) {
parent->shape_owner_set_one_way_collision(owner_id, one_way_collision);
}
- /*if (get_tree()->is_editor_hint()) {
+ /*if (Engine::get_singleton()->is_editor_hint()) {
//display above all else
set_z_as_relative(false);
set_z(VS::CANVAS_ITEM_Z_MAX - 1);
@@ -158,7 +159,7 @@ void CollisionPolygon2D::_notification(int p_what) {
case NOTIFICATION_DRAW: {
- if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
+ if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
break;
}
diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp
index ff4aa245ec..3fda4ab464 100644
--- a/scene/2d/collision_shape_2d.cpp
+++ b/scene/2d/collision_shape_2d.cpp
@@ -28,7 +28,9 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "collision_shape_2d.h"
+
#include "collision_object_2d.h"
+#include "engine.h"
#include "scene/resources/capsule_shape_2d.h"
#include "scene/resources/circle_shape_2d.h"
#include "scene/resources/concave_polygon_shape_2d.h"
@@ -59,7 +61,7 @@ void CollisionShape2D::_notification(int p_what) {
parent->shape_owner_set_one_way_collision(owner_id, one_way_collision);
}
- /*if (get_tree()->is_editor_hint()) {
+ /*if (Engine::get_singleton()->is_editor_hint()) {
//display above all else
set_z_as_relative(false);
set_z(VS::CANVAS_ITEM_Z_MAX - 1);
@@ -90,7 +92,7 @@ void CollisionShape2D::_notification(int p_what) {
} break;*/
case NOTIFICATION_DRAW: {
- if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
+ if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
break;
}
diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp
index 1bb40a28b5..ee41dca3a6 100644
--- a/scene/2d/joints_2d.cpp
+++ b/scene/2d/joints_2d.cpp
@@ -28,6 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "joints_2d.h"
+
+#include "engine.h"
#include "physics_body_2d.h"
#include "servers/physics_2d_server.h"
@@ -152,7 +154,7 @@ void PinJoint2D::_notification(int p_what) {
if (!is_inside_tree())
break;
- if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
+ if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
break;
}
@@ -227,7 +229,7 @@ void GrooveJoint2D::_notification(int p_what) {
if (!is_inside_tree())
break;
- if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
+ if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
break;
}
@@ -317,7 +319,7 @@ void DampedSpringJoint2D::_notification(int p_what) {
if (!is_inside_tree())
break;
- if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
+ if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) {
break;
}
diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp
index ffe69fa93f..2b11913ddf 100644
--- a/scene/2d/light_2d.cpp
+++ b/scene/2d/light_2d.cpp
@@ -28,6 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "light_2d.h"
+
+#include "engine.h"
#include "servers/visual_server.h"
void Light2D::edit_set_pivot(const Point2 &p_pivot) {
@@ -70,7 +72,7 @@ void Light2D::_update_light_visibility() {
#ifdef TOOLS_ENABLED
if (editor_only) {
- if (!get_tree()->is_editor_hint()) {
+ if (!Engine::get_singleton()->is_editor_hint()) {
editor_ok = false;
} else {
editor_ok = (get_tree()->get_edited_scene_root() && (this == get_tree()->get_edited_scene_root() || get_owner() == get_tree()->get_edited_scene_root()));
diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp
index a1a8e7d9c4..e926ca0fe1 100644
--- a/scene/2d/light_occluder_2d.cpp
+++ b/scene/2d/light_occluder_2d.cpp
@@ -29,6 +29,8 @@
/*************************************************************************/
#include "light_occluder_2d.h"
+#include "engine.h"
+
void OccluderPolygon2D::set_polygon(const PoolVector<Vector2> &p_polygon) {
polygon = p_polygon;
@@ -130,7 +132,7 @@ void LightOccluder2D::_notification(int p_what) {
if (p_what == NOTIFICATION_DRAW) {
- if (get_tree()->is_editor_hint()) {
+ if (Engine::get_singleton()->is_editor_hint()) {
if (occluder_polygon.is_valid()) {
diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp
index 779751c1c5..7515d486c2 100644
--- a/scene/2d/navigation_polygon.cpp
+++ b/scene/2d/navigation_polygon.cpp
@@ -30,6 +30,7 @@
#include "navigation_polygon.h"
#include "core_string_names.h"
+#include "engine.h"
#include "navigation2d.h"
#include "thirdparty/misc/triangulator.h"
@@ -297,7 +298,7 @@ void NavigationPolygonInstance::set_enabled(bool p_enabled) {
}
}
- if (get_tree()->is_editor_hint() || get_tree()->is_debugging_navigation_hint())
+ if (Engine::get_singleton()->is_editor_hint() || get_tree()->is_debugging_navigation_hint())
update();
//update_gizmo();
@@ -352,7 +353,7 @@ void NavigationPolygonInstance::_notification(int p_what) {
} break;
case NOTIFICATION_DRAW: {
- if (is_inside_tree() && (get_tree()->is_editor_hint() || get_tree()->is_debugging_navigation_hint()) && navpoly.is_valid()) {
+ if (is_inside_tree() && (Engine::get_singleton()->is_editor_hint() || get_tree()->is_debugging_navigation_hint()) && navpoly.is_valid()) {
PoolVector<Vector2> verts = navpoly->get_vertices();
int vsize = verts.size();
@@ -432,7 +433,7 @@ Ref<NavigationPolygon> NavigationPolygonInstance::get_navigation_polygon() const
void NavigationPolygonInstance::_navpoly_changed() {
- if (is_inside_tree() && (get_tree()->is_editor_hint() || get_tree()->is_debugging_navigation_hint()))
+ if (is_inside_tree() && (Engine::get_singleton()->is_editor_hint() || get_tree()->is_debugging_navigation_hint()))
update();
}
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp
index 0e83b9aaae..a5a59252a9 100644
--- a/scene/2d/parallax_layer.cpp
+++ b/scene/2d/parallax_layer.cpp
@@ -28,6 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "parallax_layer.h"
+
+#include "engine.h"
#include "parallax_background.h"
void ParallaxLayer::set_motion_scale(const Size2 &p_scale) {
@@ -111,7 +113,7 @@ void ParallaxLayer::set_base_offset_and_scale(const Point2 &p_offset, float p_sc
if (!is_inside_tree())
return;
- if (get_tree()->is_editor_hint())
+ if (Engine::get_singleton()->is_editor_hint())
return;
Point2 new_ofs = ((orig_offset + p_offset) * motion_scale) * p_scale + motion_offset;
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp
index a2ec33f403..40c16e5062 100644
--- a/scene/2d/particles_2d.cpp
+++ b/scene/2d/particles_2d.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "particles_2d.h"
+#include "engine.h"
#include "scene/3d/particles.h"
#include "scene/scene_string_names.h"
@@ -295,7 +296,7 @@ void Particles2D::_notification(int p_what) {
VS::get_singleton()->canvas_item_add_particles(get_canvas_item(), particles, texture_rid, normal_rid, h_frames, v_frames);
#ifdef TOOLS_ENABLED
- if (get_tree()->is_editor_hint() && (this == get_tree()->get_edited_scene_root() || get_tree()->get_edited_scene_root()->is_a_parent_of(this))) {
+ if (Engine::get_singleton()->is_editor_hint() && (this == get_tree()->get_edited_scene_root() || get_tree()->get_edited_scene_root()->is_a_parent_of(this))) {
draw_rect(visibility_rect, Color(0, 0.7, 0.9, 0.4), false);
}
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp
index 6b30e97de8..a79f60c96f 100644
--- a/scene/2d/path_2d.cpp
+++ b/scene/2d/path_2d.cpp
@@ -28,6 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "path_2d.h"
+
+#include "engine.h"
#include "scene/scene_string_names.h"
void Path2D::_notification(int p_what) {
@@ -35,7 +37,7 @@ void Path2D::_notification(int p_what) {
if (p_what == NOTIFICATION_DRAW && curve.is_valid()) {
//draw the curve!!
- if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_navigation_hint()) {
+ if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_navigation_hint()) {
return;
}
@@ -56,7 +58,7 @@ void Path2D::_notification(int p_what) {
void Path2D::_curve_changed() {
- if (is_inside_tree() && get_tree()->is_editor_hint())
+ if (is_inside_tree() && Engine::get_singleton()->is_editor_hint())
update();
}
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index 6ec1642138..3fd442429d 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -28,6 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "physics_body_2d.h"
+
+#include "engine.h"
#include "scene/scene_string_names.h"
void PhysicsBody2D::_notification(int p_what) {
@@ -802,13 +804,13 @@ void RigidBody2D::_notification(int p_what) {
#ifdef TOOLS_ENABLED
if (p_what == NOTIFICATION_ENTER_TREE) {
- if (get_tree()->is_editor_hint()) {
+ if (Engine::get_singleton()->is_editor_hint()) {
set_notify_local_transform(true); //used for warnings and only in editor
}
}
if (p_what == NOTIFICATION_LOCAL_TRANSFORM_CHANGED) {
- if (get_tree()->is_editor_hint()) {
+ if (Engine::get_singleton()->is_editor_hint()) {
update_configuration_warning();
}
}
diff --git a/scene/2d/position_2d.cpp b/scene/2d/position_2d.cpp
index 74ad9c17e2..7688faa23b 100644
--- a/scene/2d/position_2d.cpp
+++ b/scene/2d/position_2d.cpp
@@ -28,6 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "position_2d.h"
+
+#include "engine.h"
#include "scene/resources/texture.h"
void Position2D::_draw_cross() {
@@ -52,7 +54,7 @@ void Position2D::_notification(int p_what) {
case NOTIFICATION_DRAW: {
if (!is_inside_tree())
break;
- if (get_tree()->is_editor_hint())
+ if (Engine::get_singleton()->is_editor_hint())
_draw_cross();
} break;
diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp
index cfb4059714..fbec922a2d 100644
--- a/scene/2d/ray_cast_2d.cpp
+++ b/scene/2d/ray_cast_2d.cpp
@@ -28,14 +28,16 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "ray_cast_2d.h"
+
#include "collision_object_2d.h"
+#include "engine.h"
#include "physics_body_2d.h"
#include "servers/physics_2d_server.h"
void RayCast2D::set_cast_to(const Vector2 &p_point) {
cast_to = p_point;
- if (is_inside_tree() && (get_tree()->is_editor_hint() || get_tree()->is_debugging_collisions_hint()))
+ if (is_inside_tree() && (Engine::get_singleton()->is_editor_hint() || get_tree()->is_debugging_collisions_hint()))
update();
}
@@ -92,7 +94,7 @@ Vector2 RayCast2D::get_collision_normal() const {
void RayCast2D::set_enabled(bool p_enabled) {
enabled = p_enabled;
- if (is_inside_tree() && !get_tree()->is_editor_hint())
+ if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint())
set_fixed_process(p_enabled);
if (!p_enabled)
collided = false;
@@ -132,7 +134,7 @@ void RayCast2D::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: {
- if (enabled && !get_tree()->is_editor_hint())
+ if (enabled && !Engine::get_singleton()->is_editor_hint())
set_fixed_process(true);
else
set_fixed_process(false);
@@ -153,7 +155,7 @@ void RayCast2D::_notification(int p_what) {
case NOTIFICATION_DRAW: {
- if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint())
+ if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint())
break;
Transform2D xf;
xf.rotate(cast_to.angle());
diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp
index 37139b2b93..e8e5e9411f 100644
--- a/scene/2d/screen_button.cpp
+++ b/scene/2d/screen_button.cpp
@@ -112,7 +112,7 @@ void TouchScreenButton::_notification(int p_what) {
if (!is_inside_tree())
return;
- if (!get_tree()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility == VISIBILITY_TOUCHSCREEN_ONLY)
+ if (!Engine::get_singleton()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility == VISIBILITY_TOUCHSCREEN_ONLY)
return;
if (finger_pressed != -1) {
@@ -129,7 +129,7 @@ void TouchScreenButton::_notification(int p_what) {
if (!shape_visible)
return;
- if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint())
+ if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint())
return;
if (shape.is_valid()) {
Color draw_col = get_tree()->get_debug_collisions_color();
@@ -141,11 +141,11 @@ void TouchScreenButton::_notification(int p_what) {
} break;
case NOTIFICATION_ENTER_TREE: {
- if (!get_tree()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility == VISIBILITY_TOUCHSCREEN_ONLY)
+ if (!Engine::get_singleton()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility == VISIBILITY_TOUCHSCREEN_ONLY)
return;
update();
- if (!get_tree()->is_editor_hint())
+ if (!Engine::get_singleton()->is_editor_hint())
set_process_input(is_visible_in_tree());
} break;
@@ -154,7 +154,7 @@ void TouchScreenButton::_notification(int p_what) {
_release(true);
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
- if (get_tree()->is_editor_hint())
+ if (Engine::get_singleton()->is_editor_hint())
break;
if (is_visible_in_tree()) {
set_process_input(true);
diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp
index fb71b61d45..54861bbe89 100644
--- a/scene/2d/visibility_notifier_2d.cpp
+++ b/scene/2d/visibility_notifier_2d.cpp
@@ -29,20 +29,20 @@
/*************************************************************************/
#include "visibility_notifier_2d.h"
+#include "engine.h"
#include "particles_2d.h"
#include "scene/2d/animated_sprite.h"
#include "scene/2d/physics_body_2d.h"
#include "scene/animation/animation_player.h"
#include "scene/main/viewport.h"
#include "scene/scene_string_names.h"
-#include "scene/scene_string_names.h"
void VisibilityNotifier2D::_enter_viewport(Viewport *p_viewport) {
ERR_FAIL_COND(viewports.has(p_viewport));
viewports.insert(p_viewport);
- if (is_inside_tree() && get_tree()->is_editor_hint())
+ if (is_inside_tree() && Engine::get_singleton()->is_editor_hint())
return;
if (viewports.size() == 1) {
@@ -58,7 +58,7 @@ void VisibilityNotifier2D::_exit_viewport(Viewport *p_viewport) {
ERR_FAIL_COND(!viewports.has(p_viewport));
viewports.erase(p_viewport);
- if (is_inside_tree() && get_tree()->is_editor_hint())
+ if (is_inside_tree() && Engine::get_singleton()->is_editor_hint())
return;
emit_signal(SceneStringNames::get_singleton()->viewport_exited, p_viewport);
@@ -74,7 +74,7 @@ void VisibilityNotifier2D::set_rect(const Rect2 &p_rect) {
rect = p_rect;
if (is_inside_tree()) {
get_world_2d()->_update_notifier(this, get_global_transform().xform(rect));
- if (get_tree()->is_editor_hint()) {
+ if (Engine::get_singleton()->is_editor_hint()) {
update();
item_rect_changed();
}
@@ -108,7 +108,7 @@ void VisibilityNotifier2D::_notification(int p_what) {
} break;
case NOTIFICATION_DRAW: {
- if (get_tree()->is_editor_hint()) {
+ if (Engine::get_singleton()->is_editor_hint()) {
draw_rect(rect, Color(1, 0.5, 1, 0.2));
}
@@ -236,7 +236,7 @@ void VisibilityEnabler2D::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
- if (get_tree()->is_editor_hint())
+ if (Engine::get_singleton()->is_editor_hint())
return;
Node *from = this;
@@ -254,7 +254,7 @@ void VisibilityEnabler2D::_notification(int p_what) {
if (p_what == NOTIFICATION_EXIT_TREE) {
- if (get_tree()->is_editor_hint())
+ if (Engine::get_singleton()->is_editor_hint())
return;
for (Map<Node *, Variant>::Element *E = nodes.front(); E; E = E->next()) {