|
@@ -3352,6 +3352,22 @@ void Viewport::_push_unhandled_input_internal(const Ref<InputEvent> &p_event) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void Viewport::notify_mouse_entered() {
|
|
|
|
+ if (gui.mouse_in_viewport) {
|
|
|
|
+ WARN_PRINT_ED("The Viewport was previously notified that the mouse is in its area. There is no need to notify it at this time.");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ notification(NOTIFICATION_VP_MOUSE_ENTER);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void Viewport::notify_mouse_exited() {
|
|
|
|
+ if (!gui.mouse_in_viewport) {
|
|
|
|
+ WARN_PRINT_ED("The Viewport was previously notified that the mouse has left its area. There is no need to notify it at this time.");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ _mouse_leave_viewport();
|
|
|
|
+}
|
|
|
|
+
|
|
void Viewport::set_physics_object_picking(bool p_enable) {
|
|
void Viewport::set_physics_object_picking(bool p_enable) {
|
|
ERR_MAIN_THREAD_GUARD;
|
|
ERR_MAIN_THREAD_GUARD;
|
|
physics_object_picking = p_enable;
|
|
physics_object_picking = p_enable;
|
|
@@ -4799,6 +4815,8 @@ void Viewport::_bind_methods() {
|
|
#ifndef DISABLE_DEPRECATED
|
|
#ifndef DISABLE_DEPRECATED
|
|
ClassDB::bind_method(D_METHOD("push_unhandled_input", "event", "in_local_coords"), &Viewport::push_unhandled_input, DEFVAL(false));
|
|
ClassDB::bind_method(D_METHOD("push_unhandled_input", "event", "in_local_coords"), &Viewport::push_unhandled_input, DEFVAL(false));
|
|
#endif // DISABLE_DEPRECATED
|
|
#endif // DISABLE_DEPRECATED
|
|
|
|
+ ClassDB::bind_method(D_METHOD("notify_mouse_entered"), &Viewport::notify_mouse_entered);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("notify_mouse_exited"), &Viewport::notify_mouse_exited);
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("get_mouse_position"), &Viewport::get_mouse_position);
|
|
ClassDB::bind_method(D_METHOD("get_mouse_position"), &Viewport::get_mouse_position);
|
|
ClassDB::bind_method(D_METHOD("warp_mouse", "position"), &Viewport::warp_mouse);
|
|
ClassDB::bind_method(D_METHOD("warp_mouse", "position"), &Viewport::warp_mouse);
|