blob: b3336f10b3eca30436f0ac1de0f8425097d7d6da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
extends Area2D
signal hover_enter
signal hover_exit
signal select(event: InputEvent)
#func _on_area_entered(_area: Area2D) -> void:
#hover_enter.emit()
#
#
#func _on_area_exited(_area: Area2D) -> void:
#hover_exit.emit()
func _on_mouse_entered() -> void:
if not get_tree().get_first_node_in_group("selection_rectangle").is_active:
hover_enter.emit()
func _on_mouse_exited() -> void:
if not get_tree().get_first_node_in_group("selection_rectangle").is_active:
hover_exit.emit()
func _on_input_event(_viewport: Node, event: InputEvent, _shape_idx: int) -> void:
if event.is_action_pressed("select"):
select.emit(event)
|