38 lines
579 B
GDScript
38 lines
579 B
GDScript
extends Node3D
|
|
|
|
signal isFinished(text) ## enter button
|
|
|
|
var text = ""
|
|
var isShift = false
|
|
|
|
|
|
|
|
|
|
|
|
func typeText(char:Variant):
|
|
if char == "<=":
|
|
if text.length() != 0:
|
|
text = text.substr(0, text.length()-1)
|
|
elif char == "Shift":
|
|
return
|
|
elif isShift:
|
|
text += char.to_upper()
|
|
else:
|
|
text += char
|
|
|
|
|
|
func _process(delta: float) -> void:
|
|
$Label3D.text = text
|
|
|
|
|
|
func _on_shift_button_pressed(char: Variant) -> void:
|
|
isShift = true
|
|
|
|
|
|
func _on_shift_button_released() -> void:
|
|
isShift = false
|
|
|
|
|
|
func _on_return_button_pressed(char: Variant) -> void:
|
|
isFinished.emit(text)
|