diff options
Diffstat (limited to 'main/input_default.cpp')
-rw-r--r-- | main/input_default.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp index 4fcb450bce..e975d4141f 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -30,6 +30,7 @@ #include "servers/visual_server.h" #include "os/os.h" #include "input_map.h" +#include "scene/resources/texture.h" void InputDefault::SpeedTrack::update(const Vector2& p_delta_p) { @@ -463,9 +464,11 @@ void InputDefault::set_custom_mouse_cursor(const RES& p_cursor,const Vector2& p_ set_mouse_mode(MOUSE_MODE_VISIBLE); VisualServer::get_singleton()->cursor_set_visible(false); } else { + Ref<AtlasTexture> atex = custom_cursor; + Rect2 region = atex.is_valid() ? atex->get_region() : Rect2(); set_mouse_mode(MOUSE_MODE_HIDDEN); VisualServer::get_singleton()->cursor_set_visible(true); - VisualServer::get_singleton()->cursor_set_texture(custom_cursor->get_rid(),p_hotspot); + VisualServer::get_singleton()->cursor_set_texture(custom_cursor->get_rid(),p_hotspot, 0, region); VisualServer::get_singleton()->cursor_set_pos(get_mouse_pos()); } } |