ajout d'une gui en 3d, d'un tuto et correction de bug à la pelletée
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
@tool
|
||||
extends MarginContainer
|
||||
class_name ObjectivProgressBar
|
||||
|
||||
const MAX_PROGRESS_BAR_SCALE = 4.25
|
||||
const PROGRESS_BAR_WEIGHT = 0.1
|
||||
|
||||
@export var progress := 0. : set = set_progress
|
||||
@export var text := "" :
|
||||
set(v):
|
||||
text = v
|
||||
if is_node_ready():
|
||||
%ProgressText.text = v
|
||||
|
||||
func _ready():
|
||||
if progress != null:
|
||||
%ProgressBar.scale.x = progress * MAX_PROGRESS_BAR_SCALE
|
||||
%ProgressText.text = text
|
||||
|
||||
|
||||
func set_progress(_progress : float):
|
||||
progress = _progress
|
||||
if is_node_ready() and progress != null:
|
||||
%ProgressBar.scale.x = min(1., progress) * MAX_PROGRESS_BAR_SCALE
|
||||
Reference in New Issue
Block a user