mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-14 01:15:56 +00:00
Nolan Darilek
744e2727db
* Add an action to autoclose the dialog for setting keybindings after 5 seconds, thus allowing capturing keys to attach to actions. * Remove "Hello, world." from global script and move it into player. * Add commands to speak coordinates, headings, and to stop speech. * Add Quit command. * Announce new screen on change. * Other minor cleanups.
21 lines
712 B
GDScript3
21 lines
712 B
GDScript3
extends Area2D
|
|
|
|
# Declare member variables here. Examples:
|
|
# var a = 2
|
|
# var b = "text"
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
Globals.tts.speak("Hello, world.", true)
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta):
|
|
if Input.is_action_just_pressed("speak_coordinates"):
|
|
Globals.tts.speak("%s, %s" % [position.x, position.y], true)
|
|
elif Input.is_action_just_pressed("speak_heading"):
|
|
Globals.tts.speak("%s degrees" % global_rotation_degrees, true)
|
|
elif Input.is_action_pressed("quit"):
|
|
get_tree().quit()
|
|
elif Input.is_action_pressed("stop_speech"):
|
|
Globals.tts.stop()
|