0 votes

How to make the curser a custom sprite?

in Engine by (54 points)

1 Answer

0 votes
by (5,206 points)

In a more flexible way, you can hide the cursor and set a sprite at mouse position :

Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
var mouse = get_viewport().get_mouse_pos()
get_node("Crosshair").set_pos(mouse)

this seem to be a nice way, but I ran into the problem, that the sprite lags behind when going in fullscreen mode, because the game seems to update only 60 per frame (300-1000 times when in windowed mode).
Have you found a solution to that? this also is important, if I want a mouse cursor moving along the games resolution and not the screen resolution (for pixel art games)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.