parent
a28bf56ef9
commit
91add16300
5 changed files with 18 additions and 7 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue