From 75793bd23d275d10d6a0bd8024a7e412b64557ce Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 15 Dec 2024 16:53:12 +0100 Subject: next commit --- cursor.gd | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 cursor.gd (limited to 'cursor.gd') diff --git a/cursor.gd b/cursor.gd deleted file mode 100644 index 947356e..0000000 --- a/cursor.gd +++ /dev/null @@ -1,33 +0,0 @@ -extends Node2D - - -var current_action_idx := 0 -var last_action_idx := 0 - - -func _ready() -> void: - Input.mouse_mode = Input.MOUSE_MODE_HIDDEN - $Actions.play("000") - - -func _process(_delta: float) -> void: - global_position = get_global_mouse_position() - - if Input.get_current_cursor_shape() == Input.CURSOR_ARROW: - current_action_idx = 0 - elif Input.get_current_cursor_shape() == Input.CURSOR_POINTING_HAND: - current_action_idx = 2 - else: - # use default OS cursor - current_action_idx = -1 - - if current_action_idx != last_action_idx: - if current_action_idx == -1: - Input.mouse_mode = Input.MOUSE_MODE_VISIBLE - $Actions.visible = false - else: - Input.mouse_mode = Input.MOUSE_MODE_HIDDEN - $Actions.visible = true - $Actions.play(str(current_action_idx).pad_zeros(3)) - - last_action_idx = current_action_idx -- cgit v1.2.3