This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

How to make the curser a custom sprite?

in Engine by (55 points)

1 Answer

0 votes
by (5,286 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 Frequently asked questions and 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 [email protected] with your username.