Commit 526e1ae9 authored by Chloé Paris's avatar Chloé Paris

mapping

parent 6ef546fc
......@@ -96,6 +96,10 @@ B=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","dev
]
G=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":71,"unicode":0,"echo":false,"script":null)
]
W=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
]
C=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":67,"unicode":0,"echo":false,"script":null)
]
[rendering]
......
......@@ -16,7 +16,60 @@ func _ready():
func _input(event):
if event.is_class("InputEventKey") and event.is_pressed() and not event.is_echo():
if event.is_action("letter"):
if event.is_action("2letters"):
if Input.is_action_pressed("A") and Input.is_action_pressed("E"):
get_node("Viewport/hand_model/AnimationPlayer").play("AE")
elif Input.is_action_pressed("B"):
print("b")
if Input.is_action_pressed("G"):
print("g")
get_node("Viewport/hand_model/AnimationPlayer").play("BG")
if Input.is_action_pressed("L"):
print("l")
get_node("Viewport/hand_model/AnimationPlayer").play("BL")
elif Input.is_action_pressed("L") and Input.is_action_pressed("U"):
get_node("Viewport/hand_model/AnimationPlayer").play("LU")
elif event.is_action("1-5"):
var fingers
match event.as_text():
"Ampersand":
fingers = 1
"é":
fingers = 2
"QuoteDbl":
fingers = 3
"Apostrophe":
fingers = 4
"ParenLeft":
fingers = 5
"Colon":
fingers = 0
"Less":
fingers = 50
if Input.is_action_pressed("bec ferme"):
print("%d bec fermé" % fingers)
get_node("Viewport/hand_model/AnimationPlayer").play("BF-%d" % fingers)
elif Input.is_action_pressed("bec ouvert"):
print("%d bec ouvert" % fingers)
get_node("Viewport/hand_model/AnimationPlayer").play("BO-%d" % fingers)
elif Input.is_action_pressed("cone"):
print("%d cone" % fingers)
get_node("Viewport/hand_model/AnimationPlayer").play("Cone-%d" % fingers)
elif Input.is_action_pressed("plie"):
print("%d plié" % fingers)
get_node("Viewport/hand_model/AnimationPlayer").play("Plié-%d" % fingers)
elif Input.is_action_pressed("rond"):
print("%d rond" % fingers)
get_node("Viewport/hand_model/AnimationPlayer").play("Rond-%d" % fingers)
else:
print("%d normal" % fingers)
# play shape
get_node("Viewport/hand_model/AnimationPlayer").play("Chiffre-%d" % fingers)
# actually register the change
signVar.DHanimShape = "%d" % fingers
#if letter of alphabet -> want hand to display the shape of this letter
elif event.is_action("letter"):
# play letter
get_node("Viewport/hand_model/AnimationPlayer").play("Lettre-"+event.as_text())
else:
print(event.as_text())
\ No newline at end of file
# actually register the change
signVar.DHanimShape = event.as_text()
\ No newline at end of file
......@@ -3,7 +3,7 @@ extends KinematicBody
var hand
const SPEED = 60
var rot = false
const STEP = 45
const STEP = 22.5
var letter
func _ready():
......
......@@ -106,6 +106,8 @@ func _input(event):
get_node("Viewport/hand_model/AnimationPlayer").play("BL")
elif Input.is_action_pressed("L") and Input.is_action_pressed("U"):
get_node("Viewport/hand_model/AnimationPlayer").play("LU")
elif Input.is_action_pressed("W") and Input.is_action_pressed("C"):
get_node("Viewport/hand_model/AnimationPlayer").play("WC")
elif event.is_action("1-5"):
var fingers
match event.as_text():
......
......@@ -230,7 +230,7 @@ _sections_unfolded = [ "Background" ]
environment = SubResource( 7 )
[node name="state" type="Control" index="0"]
[node name="state" type="Control"]
anchor_left = 0.0
anchor_top = 0.0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment