16 lines
357 B
GDScript
16 lines
357 B
GDScript
extends ProgressBar
|
|
|
|
export(NodePath) onready var label = get_node(label) as Label
|
|
|
|
onready var font = label.get_theme_default_font()
|
|
|
|
func _ready():
|
|
_on_bar_resized()
|
|
|
|
func _on_bar_value_changed(value):
|
|
label.text = "%d / %d" % [value, max_value]
|
|
|
|
func _on_bar_resized():
|
|
label.visible = rect_size.y > 16
|
|
label.rect_size = rect_size / label.rect_scale
|