19 lines
382 B
GDScript
19 lines
382 B
GDScript
extends Sprite3D
|
|
class_name EnergyBar3D
|
|
|
|
@onready var bar : ProgressBar = $SubViewport/EnergyBar2D
|
|
|
|
func _ready() -> void:
|
|
texture = $SubViewport.get_texture()
|
|
|
|
|
|
func set_max_value(max_value : int) -> void:
|
|
bar.max_value = max_value
|
|
|
|
|
|
func set_up(value : int, max_amount : int) -> void:
|
|
bar.setup_bar(value, max_amount)
|
|
|
|
|
|
func update(value : int) -> void:
|
|
bar.update_bar(value)
|