Set mouse cursor to CURSOR_WAIT during lengthy processes

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By tx350z

During first-runt set-up of my game there are some processes that can take 2-3 seconds. I want to display the “wait” mouse cursor during those processes. I can’t find a wait to do that.

What am I missing?

:bust_in_silhouette: Reply From: Gluon

You can set the mouse cursor to any custom design you want like this

var cursor_bespoke = load("res://Mouse.png")

func _ready():
    Input.set_custom_mouse_cursor(cursor_bespoke)

Thank you for the reply. I know I can set a custom cursor.

Input.CursorShape.CURSOR_WAIT implies to me there is already a built-in cursor shape for “input wait mode”.

See https://docs.godotengine.org/en/stable/classes/class_input.html

I can get the current cursor shape by calling Input.get_current_cusor_shape(), I can set the default cursor shape by calling Input.set_default_cursor_shape (cursor_shape).

There just doesn’t seem to be a way to set the current cursor shape using the Input.CursorShape enum values.

tx350z | 2022-05-17 14:23

Okay you could try

Input.set_default_cursor_shape(4)

I think that is what you want then

Gluon | 2022-05-17 20:42

:bust_in_silhouette: Reply From: Inces

It works fine in mine project :

Input.set_default_cursor_shape(Input.CURSOR_ARROW)

Maybe the problem lies in those 3 seconds entirely freezing viewport ?

Input.CURSOR_ARROW seems to be the system default. Try

Input.set_default_cursor_shape(Input.CURSOR_BUSY).

Does not work for me.

tx350z | 2022-05-17 18:24

I just tried it and it works…
but strangely enough, it is not Gogots custom wait cursor, but it is waiting cursor animation of my current Windows system !
Could it be, that Godot reaches system information and forces it to display its cursor sprite ? What system do You use ?

Inces | 2022-05-18 06:23

I’m on Windows 11. Since it’s a small UX issue I’m not going to chase it for now. Too much other work to complete. When time allows I’ll dig into it deeper unless someone can explain exactly how to programmatically control the cursor shape.

Thanks for your help.

tx350z | 2022-05-18 09:18