Skip to content

Instantly share code, notes, and snippets.

@TheDuriel
Created September 22, 2019 11:48
Show Gist options
  • Save TheDuriel/6825dee9dde2e1d0c0e96cafe24ab308 to your computer and use it in GitHub Desktop.
Save TheDuriel/6825dee9dde2e1d0c0e96cafe24ab308 to your computer and use it in GitHub Desktop.
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