Created
September 26, 2020 11:08
-
-
Save smks/e7f7c56180390295915113e80ce16ba9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func play_dialogue_speech(): | |
emit_signal('started_speech') | |
disable_button() | |
var speech_length = speech.text.length() | |
var speech_duration = TIME_PER_LETTER * speech_length | |
speech.percent_visible = 0 | |
tween.interpolate_property( | |
speech, | |
'percent_visible', | |
0, | |
1, | |
speech_duration, | |
Tween.TRANS_LINEAR | |
) | |
tween.repeat = false | |
tween.start() | |
func finished_reading(): | |
tween.stop(speech) | |
speech.percent_visible = 0 | |
disable_button() | |
emit_signal("finished_speech") | |
func _on_Tween_tween_completed(object, key): | |
enable_button() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment