godot-webrtc-mplayer-testing/scripts/objects/bar.gd
2021-12-17 17:10:56 -06:00

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