immersive-home/content/functions/clickable.gd

39 lines
1004 B
GDScript3
Raw Normal View History

2023-11-11 19:17:25 +02:00
extends Function
class_name Clickable
2023-11-27 01:23:19 +02:00
signal on_click(event: EventPointer)
signal on_press_down(event: EventPointer)
signal on_press_move(event: EventPointer)
signal on_press_up(event: EventPointer)
signal on_grab_down(event: EventPointer)
signal on_grab_move(event: EventPointer)
signal on_grab_up(event: EventPointer)
signal on_ray_enter(event: EventPointer)
signal on_ray_leave(event: EventPointer)
func _on_click(event: EventPointer):
2023-11-11 19:17:25 +02:00
on_click.emit(event)
2023-11-27 01:23:19 +02:00
func _on_press_down(event: EventPointer):
2023-11-11 19:17:25 +02:00
on_press_down.emit(event)
2023-11-27 01:23:19 +02:00
func _on_press_move(event: EventPointer):
2023-11-11 19:17:25 +02:00
on_press_move.emit(event)
2023-11-27 01:23:19 +02:00
func _on_press_up(event: EventPointer):
2023-11-11 19:17:25 +02:00
on_press_up.emit(event)
2023-11-27 01:23:19 +02:00
func _on_grab_down(event: EventPointer):
2023-11-11 19:17:25 +02:00
on_grab_down.emit(event)
2023-11-27 01:23:19 +02:00
func _on_grab_move(event: EventPointer):
2023-11-11 19:17:25 +02:00
on_grab_move.emit(event)
2023-11-27 01:23:19 +02:00
func _on_grab_up(event: EventPointer):
2023-11-11 19:17:25 +02:00
on_grab_up.emit(event)
2023-11-27 01:23:19 +02:00
func _on_ray_enter(event: EventPointer):
2023-11-11 19:17:25 +02:00
on_ray_enter.emit(event)
2023-11-27 01:23:19 +02:00
func _on_ray_leave(event: EventPointer):
2023-11-11 19:17:25 +02:00
on_ray_leave.emit(event)