#Making custom mouse cursor be on the top of the mouse
7 messages · Page 1 of 1 (latest)
Right now my temporary solution is to manually offset functions like get_global_mouse_position() but that is likely going to be tedious to do all the time
Nevermind, I managed to find the settings
It would be good form to explain your solution instead of just saying that you have one.
I have been wondering for a while how to do this, but never got around to try and find out.
So what does your code look like?
The way I found was to create a script and autoload it.
'''
extends Node
var cursor = load("Path of your cursor image")
func _ready() -> void:
Input.set_custom_mouse_cursor(cursor, Input.CURSOR_ARROW)
'''
CURSOR_ARROW would be the cursor you change and this one is the default arrow.
There is other parameter called Hotspot, but from your description, it does not sound like you need it.
Here is the Godot Documentation where you will find the set_custom_mouse_cursor method
https://docs.godotengine.org/en/stable/classes/class_input.html?highlight=set_custom_mouse_cursor
Inherits: Object A singleton that deals with inputs. Description: A singleton that deals with inputs. This includes key presses, mouse buttons and movement, joypads, and input actions. Actions and ...
Ah, sorry, forgot to check back here until now. In project settings, under mouse cursor, there are settings that let you change them. using the Custom Image Hotspot settings, you can manually change the offset there to get it where you want it
That changes it universally