2023-11-28 00:46:05 +02:00
|
|
|
extends EventBubble
|
2024-03-17 01:14:31 +02:00
|
|
|
## Emitted when a finger enters or leaves a FingerArea.
|
2023-11-28 00:46:05 +02:00
|
|
|
class_name EventTouch
|
|
|
|
|
2024-03-17 01:14:31 +02:00
|
|
|
const Finger = preload ("res://lib/utils/touch/finger.gd")
|
2023-11-28 00:46:05 +02:00
|
|
|
|
2024-03-17 01:14:31 +02:00
|
|
|
## The list of fingers that are currently in the area.
|
2023-11-28 00:46:05 +02:00
|
|
|
var fingers: Array[Finger] = []
|
|
|
|
|
2024-03-17 01:14:31 +02:00
|
|
|
## Checks if a specific finger is currently in the area.
|
2023-11-28 00:46:05 +02:00
|
|
|
func has_finger(finger: Finger.Type):
|
|
|
|
for f in fingers:
|
|
|
|
if f.type == finger:
|
|
|
|
return true
|
|
|
|
return false
|