Files
car-os/widgets/rotation/scripts/pitch_widget_node.gd
T

20 lines
456 B
GDScript
Raw Normal View History

2026-07-04 18:22:23 -06:00
extends BaseWidgetNode
class_name PitchWidgetNode
var sprite: Sprite2D
var label: Label
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
sprite = get_node("Sprite2D")
label = get_node("Label")
var label_size = label.size
func _update_data():
if sprite == null or label == null:
return
sprite.rotation = host_vehicle.pitch_rad
label.text = str(round(rad_to_deg(host_vehicle.pitch_rad)*10)/10) + " \u00B0"