|
@@ -30,6 +30,8 @@
|
|
|
|
|
|
#include "node_2d.h"
|
|
#include "node_2d.h"
|
|
|
|
|
|
|
|
+#include "scene/main/viewport.h"
|
|
|
|
+
|
|
#ifdef TOOLS_ENABLED
|
|
#ifdef TOOLS_ENABLED
|
|
Dictionary Node2D::_edit_get_state() const {
|
|
Dictionary Node2D::_edit_get_state() const {
|
|
Dictionary state;
|
|
Dictionary state;
|
|
@@ -389,6 +391,16 @@ bool Node2D::is_y_sort_enabled() const {
|
|
return y_sort_enabled;
|
|
return y_sort_enabled;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void Node2D::_notification(int p_notification) {
|
|
|
|
+ switch (p_notification) {
|
|
|
|
+ case NOTIFICATION_MOVED_IN_PARENT: {
|
|
|
|
+ if (get_viewport()) {
|
|
|
|
+ get_viewport()->gui_set_root_order_dirty();
|
|
|
|
+ }
|
|
|
|
+ } break;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
void Node2D::_bind_methods() {
|
|
void Node2D::_bind_methods() {
|
|
ClassDB::bind_method(D_METHOD("set_position", "position"), &Node2D::set_position);
|
|
ClassDB::bind_method(D_METHOD("set_position", "position"), &Node2D::set_position);
|
|
ClassDB::bind_method(D_METHOD("set_rotation", "radians"), &Node2D::set_rotation);
|
|
ClassDB::bind_method(D_METHOD("set_rotation", "radians"), &Node2D::set_rotation);
|