taloria/game/scripts/ui/panel.gd
torsten 9b5bbae71c game: 1920x1080-Viewport, BMFonts und 3x-UI
- project.godot: 1920x1080 (1080p 1x, 4K 2x), Fenster 1920x1080
- Press Start 2P 24 und Pirata One 36 importiert; 8x10-Satz entfernt
- UiPanel auf 36x36-Panel mit Rand 6 umgestellt
- 3x-Assets und UI-Elemente in game/assets (1:1 aus final3x)
2026-11-15 15:30:26 +01:00

20 lines
670 B
GDScript

class_name UiPanel
extends NinePatchRect
## Das 9-Slice-Panel aus art/final3x/UI (docs/ui.md §3).
##
## Rand 6 px: 3 px Rahmenlinie + 3 px Bevel. Die Engine rendert im
## 1920x1080-Viewport, also 1:1 mit dem Asset. Jede Instanz ist pixelgleich
## zu `panel()` aus art/tools/ui3.py — geprüft von art/tools/ui_slice.py
## für 12x12 bis 1200x168 (Basis 1920).
const TEXTUR := "res://assets/ui/ui_panel_9slice_36px.png"
const RAND := 6
func _ready() -> void:
if texture == null:
texture = load(TEXTUR)
patch_margin_left = RAND
patch_margin_top = RAND
patch_margin_right = RAND
patch_margin_bottom = RAND
texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST