checheche/Robo-Bus-A31-HMI/code/speedometer.gd
2024-12-11 23:26:40 +08:00

15 lines
361 B
GDScript

@tool
extends TextureProgressBar
@export var _max_value :float= 0
@export var _value :float= 0
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func _process(delta: float) -> void:
_value = clampf(_value,0,_max_value)
material.set_shader_parameter("value",_value/_max_value)
pass