20 lines
423 B
GDScript
20 lines
423 B
GDScript
extends HBoxContainer
|
|
|
|
var showSymbol = true
|
|
|
|
func set_display(amount:int):
|
|
var amountText = ""
|
|
|
|
if amount < 0:
|
|
$Amount.set("theme_override_colors/font_color", Color.RED)
|
|
elif amount > 0:
|
|
if showSymbol:
|
|
amountText = "+ "
|
|
$Amount.set("theme_override_colors/font_color", Color.GREEN)
|
|
else:
|
|
$Amount.set("theme_override_colors/font_color", Color.WHITE)
|
|
|
|
amountText += str(amount)
|
|
|
|
$Amount.text = amountText
|