checheche/Robo-Bus-A31-HMI/code/speedometer.gd

15 lines
361 B
GDScript3
Raw Normal View History

2024-12-10 14:59:20 +08:00
@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