Created
September 22, 2019 11:48
-
-
Save TheDuriel/6825dee9dde2e1d0c0e96cafe24ab308 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
extends Label | |
const DURATION: float = 10.0 | |
var countdown: int = 10 setget set_countdown | |
var _t: Tween = Tween.new() | |
func set_countdown(new_value: int) -> void: | |
countdown = new_value | |
text = str(countdown) | |
func _ready() -> void: | |
add_child(_t) | |
# _t.interpolate_property(self, "modulate", | |
# Color.red, Color.green, DURATION * 0.5, | |
# Tween.TRANS_LINEAR, Tween.EASE_IN) | |
_t.interpolate_property(self, "modulate", | |
modulate, Color.red, DURATION * 0.5, | |
Tween.TRANS_LINEAR, Tween.EASE_IN, DURATION * 0.5) | |
_t.interpolate_property(self, "countdown", | |
10, 0, DURATION, | |
Tween.TRANS_LINEAR, Tween.EASE_IN) | |
_t.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment