few UX improvements
This commit is contained in:
19
utils/clickable.gd
Normal file
19
utils/clickable.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
extends Area2D
|
||||
class_name Clickable
|
||||
|
||||
|
||||
signal on_clicked
|
||||
|
||||
|
||||
func _on_mouse_entered() -> void:
|
||||
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_POINTING_HAND)
|
||||
|
||||
|
||||
func _on_mouse_exited() -> void:
|
||||
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_ARROW)
|
||||
|
||||
|
||||
func _on_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void:
|
||||
if event is InputEventMouseButton and event.is_pressed():
|
||||
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_ARROW)
|
||||
on_clicked.emit()
|
||||
1
utils/clickable.gd.uid
Normal file
1
utils/clickable.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d3f721y4183yy
|
||||
Reference in New Issue
Block a user