Add Exponential table progress bar

This commit is contained in:
JonShard
2026-07-30 11:09:43 +02:00
parent d71f3824cf
commit 9cdf0fc787
3 changed files with 40 additions and 58 deletions
+5 -1
View File
@@ -2,6 +2,7 @@ extends Node3D
class_name ProgressBar3D
@export var y_billboard: bool = false
@export var exponential:bool = false
@onready var progress_bar: ProgressBar = $Sprite3D/SubViewport/ProgressBar
@onready var sprite_3d: Sprite3D = $Sprite3D
@@ -14,7 +15,10 @@ func _ready() -> void:
$Sprite3D.billboard = BaseMaterial3D.BillboardMode.BILLBOARD_FIXED_Y
func set_progress(value: float) -> void:
progress_bar.value = clamp(value, 0.0, 1.0) * 100
if exponential:
progress_bar.value = clamp(pow(value, 2.1), 0.0, 1.0) * 100
else:
progress_bar.value = clamp(value, 0.0, 1.0) * 100
func get_progress() -> float: