mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 00:14:00 +00:00
feat(ui): theme HUD with Orbitron typography
This commit is contained in:
@@ -73,7 +73,7 @@ func _draw() -> void:
|
||||
draw_line(Vector2(-half_chord, horizon_y), Vector2(half_chord, horizon_y), LINE_COLOR, 2.0)
|
||||
|
||||
# Pitch ladder: rungs every 10 degrees, labelled, scrolling with pitch.
|
||||
var font := ThemeDB.fallback_font
|
||||
var font := hud_font()
|
||||
for ladder_deg: int in [-30, -20, -10, 10, 20, 30]:
|
||||
var y := horizon_y - ladder_deg * px_per_deg
|
||||
if absf(y) > radius - 12.0:
|
||||
|
||||
@@ -37,7 +37,7 @@ func _process(delta: float) -> void:
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
var font := ThemeDB.fallback_font
|
||||
var font := hud_font()
|
||||
var fraction := clampf(_value / max_value, 0.0, 1.0)
|
||||
var reading := value_format % _value
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ func _process(delta: float) -> void:
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
var font := ThemeDB.fallback_font
|
||||
var font := hud_font()
|
||||
var center_x := size.x / 2.0
|
||||
var px_per_deg := size.x / VISIBLE_RANGE
|
||||
|
||||
|
||||
@@ -23,3 +23,11 @@ static func angle_delta_deg(from: float, to: float) -> float:
|
||||
|
||||
func _smoothing_weight(delta: float) -> float:
|
||||
return 1.0 - exp(-SMOOTHING * delta) # frame-rate independent
|
||||
|
||||
|
||||
# Procedural draw calls do not automatically consume a Control's theme font;
|
||||
# resolve it explicitly so every instrument uses the same packaged typeface
|
||||
# as ordinary Labels instead of ThemeDB's debug-looking fallback.
|
||||
func hud_font() -> Font:
|
||||
var font := get_theme_default_font()
|
||||
return font if font else ThemeDB.fallback_font
|
||||
|
||||
Reference in New Issue
Block a user