You can use a custom cursor by doing something like this:
Create a sprite with a texture that you want to change to (hand or any custom design) and set it hidden by default.
Add a CollisionShape2D
or a CollisionPolygon2D
to your Area2D
object(s), and wire the events up to trigger hiding the mouse cursor and showing your own on entering the area, have the movement event move your custom MouseSprite
around while the cursor is within the area, and restoring the original upon exit, such as:
func _on_Area2D_mouse_enter():
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
get_node("MouseSprite").show()
func _on_Area2D_mouse_exit():
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
get_node("MouseSprite").hide()
func _on_Area2D_input_event( viewport, event, shape_idx ):
var mouse_pos = get_viewport().get_mouse_pos()
get_node("MouseSprite").set_pos(mouse_pos)