1
Fork 0
mirror of https://github.com/Steffo99/nanogolf.git synced 2024-11-28 02:54:19 +00:00
algodist-steffo-nanogolf/scenes/score_label.gd

27 lines
540 B
GDScript3
Raw Normal View History

2024-03-19 02:55:32 +00:00
extends RichTextLabel
class_name ScoreLabel
func set_partial(value: int):
if value == -1:
text = "[code][right]-[/right][/code]"
else:
text = "[code][right]%s[/right][/code]" % value
func set_total(value: int):
if value == -1:
text = "[code][right]-[/right][/code]"
else:
text = "[code][right][b]%s[/b][/right][/code]" % value
func set_player_color(value: Color):
modulate.r = value.r
modulate.g = value.g
modulate.b = value.b
func set_possessed(value: int):
if value == 1:
modulate.a = 0.3
else:
modulate.a = 1.0