diff --git a/art/README.md b/art/README.md index c02ce3e..594cc2e 100644 --- a/art/README.md +++ b/art/README.md @@ -13,7 +13,7 @@ Neuer Rechner: [`SETUP.md`](SETUP.md) — `python3 art/tools/setup.py check`. ## Kategorien -Sieben Kategorien, nach **Funktion im Spiel** sortiert — nicht nach Motiv. +Acht Kategorien, nach **Funktion im Spiel** sortiert — nicht nach Motiv. Ein Wolf ist `Creatures`, auch wenn er in einem Wald steht; der Wald ist `Terrain`, auch wenn ein Wolf drin sitzt. @@ -26,6 +26,7 @@ Ein Wolf ist `Creatures`, auch wenn er in einem Wald steht; der Wald ist | `NPCs/` | Stadt- und Dungeon-Bewohner als Top-down-Sprites | 32×40 | 64×80 (2×) | A (flach) | ja | | `Objects/` | einzelne Dinge: Waffen, Türen, Kisten, Icons | 32×32 | 64×64 (2×) | A (flach) | ja | | `UI/` | Dialoge, Fenster, Buttons, Slots, Balken, Party-Rahmen — **prozedural** | variabel, 1× im 640×360-Raster | 2× nearest | A (flach) | teils | +| `Font/` | die 8×10-Schrift als **BMFont** (Atlas + `.fnt`) | 8×10-Zelle | Atlas 1× und 2× | A (1 Bit) | nein | > **Basis 640×360 (entschieden 14.11.2026).** Die Ausgabe ist überall 2× > (720p) bzw. 3× (1080p); die Elementgrößen sind entschieden (Kacheln 32, @@ -33,17 +34,21 @@ Ein Wolf ist `Creatures`, auch wenn er in einem Wald steht; der Wald ist > erledigt (14.11.2026):** `Terrain`, `Creatures`, `Players`, `NPCs` und > `Objects` liegen in 2× vor, umgerechnet mit > [`tools/nachlauf2x.py`](tools/nachlauf2x.py) — verlustfrei, ohne Neubau. -> Ausnahme: `Pictures/` ist noch mit `--size 320x180` gerechnet und braucht -> einen echten Neulauf aus dem Rohbild. +> `Pictures/` ist am 15.11. aus den Rohbildern neu gerechnet (es war der +> einzige Fall, in dem Halbieren nicht reichte). Damit ist der Nachlauf +> abgeschlossen; Ausnahme gibt es keine mehr. Alle drei Sprite-Kategorien laufen mit `--cutout 12 --outline auto --recenter`. `--levels 0.5 --gamma 1.15` zusätzlich bei dunklen Figuren (`Players`) und `Objects` — sonst verschwinden sie auf dunklem Grund. -`UI/` ist die Ausnahme in der Pipeline: gezeichnet von -[`tools/ui.py`](tools/ui.py), nicht generiert und nicht durch `pixelize.py` -geschickt. Begründung und Regeln in -[`final/UI/README.md`](final/UI/README.md). +`UI/` und `Font/` sind die Ausnahme in der Pipeline: gezeichnet von +[`tools/ui.py`](tools/ui.py) bzw. gesetzt in +[`tools/font8.py`](tools/font8.py), nicht generiert und nicht durch +`pixelize.py` geschickt. Die Schrift wird über +[`tools/font_export.py`](tools/font_export.py) als BMFont ausgeliefert. +Begründung und Regeln in [`final/UI/README.md`](final/UI/README.md) und +[`final/Font/README.md`](final/Font/README.md). `Terrain` ist etwas anderes als „Landschaft im Bild": es sind die **Kacheln für Karten** — Overland, Städte, Dungeons, Schlachtfeld —, aus denen sich die Welt @@ -53,7 +58,7 @@ Kapitel, Illustration). ## Warum zwei Stile `Pictures` ist **B** (gemalt, 64 Farben, Tonwertkorrektur), alles andere — -`Terrain`, `Creatures`, `Players`, `NPCs`, `Objects`, `UI` — ist **A** (flach, +`Terrain`, `Creatures`, `Players`, `NPCs`, `Objects`, `UI`, `Font` — ist **A** (flach, 16–32 Farben, harte Kanten). Begründung: bei 32×32 und 96×96 ist Detail ein Nachteil, bei 640×360 ist es die halbe Atmosphäre. Details in [`WORKFLOW.md`](WORKFLOW.md) §3. @@ -74,7 +79,11 @@ art/ tools/pixelize.py Downscale, Palette, Dither, Freisteller tools/nachlauf2x.py 4x -> 2x nachziehen (Nachlauf 14.11.2026, verlustfrei) tools/ui.py UI-Elemente zeichnen (1x, kein Modell, kein pixelize) + tools/ui_slice.py 9-Slice-Panel gegen panel() prüfen + Belegblatt tools/ui_probe.py Auflösungs-Gegenprobe: Dialog/Kampf bei 320x180 vs 640x360 + tools/font8.py der 8x10-Satz als Python-Daten (Quelle der Schrift) + tools/font_export.py font8.py -> BMFont + Atlas, prüft sich selbst + tools/referenz.py Referenzblatt: je Kategorie 2-5 freigegebene Assets tools/falgen.py fal.ai-Lauf: Allowlist, Preisabfrage, Rohbild, Lizenzzeile tools/vergleich.py beschriftetes Vergleichsblatt aus beliebigen Bildern tools/battle_mock.py Kampfszenen-Mock: Top-down-Feld + UI, 640x360/1280x720 @@ -83,6 +92,7 @@ art/ workflows/ ComfyUI-Jobdateien, eine pro Motiv (flux2_klein9b_api.json = Standard) license-log.csv jede Generierung, mit Prompt und Seed final// pixelize-Ergebnisse, engine-fertig + final/_referenz.png Referenzblatt aller Kategorien (2x) - der Maßstab final/_versuche/ verworfene Varianten (nicht ausliefern) prep/ Arbeitsunterlagen: Auflösungs-Gegenprobe (nicht verbindlich) .gdignore hält den Ordner aus dem Godot-Import diff --git a/art/WORKFLOW.md b/art/WORKFLOW.md index 0a8c4e3..c79013e 100644 --- a/art/WORKFLOW.md +++ b/art/WORKFLOW.md @@ -422,6 +422,16 @@ Checkbox, Slider, Tooltip, Cursor, Ladebalken. Die Mocks liegen heute über echten Karten (`prep/map-mock/`, `prep/battle-mock/`) — das ist der eigentliche Test. Die alten Szenen-Mocks `_mock_hud_A/B` sind gelöscht. +**Nachtrag 15.11.2026:** Zwei Bausteine, die in die Engine wandern, gibt es +inzwischen als Datei statt als Prozedur: + +- **9-Slice-Panel** (`final/UI/ui_panel_9slice_12px.png`, Rand 2 px bei 1×) — + damit füllt ein `NinePatchRect` jedes Fenster ohne eigene Zeichenroutine. + Belegt pixelgleich zu `panel()`: `tools/ui_slice.py`. +- **Schrift als BMFont** (`final/Font/`) — `tools/font_export.py` schreibt + Atlas und `.fnt` aus `tools/font8.py` und prüft sie ohne Godot, indem es + alle 93 Zeichen aus der Datei setzt und mit `font8.draw_text` vergleicht. + Was die Umsetzung gelehrt hat: | Befund | Konsequenz | diff --git a/art/final/Font/README.md b/art/final/Font/README.md new file mode 100644 index 0000000..5af91a8 --- /dev/null +++ b/art/final/Font/README.md @@ -0,0 +1,80 @@ +# Font — der 8×10-Pixelsatz als Engine-Datei + +Der Satz wird **nicht gezeichnet und nicht generiert**, sondern steht als +Python-Daten in [`../../tools/font8.py`](../../tools/font8.py) (`#` = Pixel). +Die UI-Elemente und die Mocks benutzen ihn direkt; für die Engine wird er +hierher exportiert. + +| | | +|---|---| +| Zelle | **8×10** (Glyphe 6 Spalten, 1 px Vorlauf, 1 px Luft) | +| Vorschub | 8 px | +| Zeile | 12 px | +| Basislinie | 8 px | +| Zeichen | 93 — A–Z, a–z, 0–9, `Ä Ö Ü ä ö ü ß`, Satz- und Rechenzeichen | +| Format | **BMFont** (Textformat) + PNG-Atlas | +| Stil | Richtung **A**, 1 Bit (keine Graustufen) | + +## Inhalt + +| Datei | Größe | Inhalt | +|---|---|---| +| `font8_10_atlas.png` | 128×60 | Glyphen weiß auf transparent, 16 pro Zeile, 1× | +| `font8_10.fnt` | — | BMFont für die 1×-Textur | +| `font8_10_atlas_2x.png` | 256×120 | dasselbe nearest-verdoppelt | +| `font8_10_2x.fnt` | — | BMFont für die 2×-Textur (Vorschub 16, Zeile 24, Basis 16) | + +Alle Glyphen sind weiß; gefärbt wird in der Engine über `modulate`. Ein eigener +Satz pro Farbe wäre vierzehnmal dieselbe Textur. + +**Nicht enthalten:** `# $ @ \ ^ _ ` + "`" + ` { } | ~`. Unbekannte Zeichen +zeichnet `font8` als `?` — das fällt beim Referenzblatt sofort auf (die erste +Fassung des Blattes schrieb `palette_tiles` als `?palette?tiles`). Wer sie +braucht, ergänzt sie in `font8.GLYPHS` und exportiert neu; für Dialogtext sind +sie entbehrlich. + +## Erzeugen und prüfen + +```bash +python3 ../../tools/font_export.py # schreiben + prüfen +python3 ../../tools/font_export.py --check # nur prüfen +``` + +Der Export ist **verifiziert, ohne Godot zu brauchen**: `--check` liest die +geschriebene `.fnt` mit einem eigenen Parser, setzt alle 93 Zeichen nur aus +den Metriken und der Textur zusammen und vergleicht das Ergebnis Pixel für +Pixel mit `font8.draw_text`. Weicht ein Zeichen ab, schlägt der Lauf fehl — +die Datei ist dann falsch, nicht die Engine. + +Belegbild: [`../../prep/font8/_bmfont_probe.png`](../../prep/font8/_bmfont_probe.png) +(aus der `.fnt` gesetzt, nicht aus `font8.py`). + +## In Godot + +1. `font8_10.fnt` und `font8_10_atlas.png` importieren — Godot erkennt das + `.fnt` als `FontFile`. +2. Am FontFile: **Antialiasing aus**, **Hinting aus**, + **Subpixel-Positionierung aus**, Filterung **nearest**. Jede Glättung macht + die 1-px-Striche kaputt. +3. `size` in `Label`/`RichTextLabel` bleibt 10 (bzw. 20 mit der 2×-Fassung); + größer skalieren heißt nearest, nicht neu rastern. + +Welche der beiden Fassungen man nimmt, hängt am Projektaufbau: läuft die UI im +640×360-Viewport und wird als Ganzes skaliert, ist die **1×**-Fassung richtig. +Zeichnet man UI außerhalb des Viewports (oder will schärfere Kanten bei 3× +Ausgabe), nimmt man die 2×-Fassung. Beides ist derselbe Satz, kein Umbau. + +## Ändern + +Ein Zeichen ist ein Eintrag in `font8.GLYPHS`: zehn Zeilen à sechs Zeichen, +`#` = Pixel. Danach `font_export.py` laufen lassen — Atlas und `.fnt` werden +neu geschrieben und geprüft. **Nie** die PNG-Datei direkt bearbeiten: sie ist +Ausgabe, die Quelle ist der Python-Datenblock. + +Zwei Regeln, die beim Setzen zählen: + +- **1 px Vorlauf, 1 px Luft.** `draw_text` setzt die Glyphe auf `x+rx+1`; im + Atlas liegt sie deshalb ebenfalls auf Spalte 1. Wer das übersieht, bekommt + Text, der 1 px zu weit links sitzt. +- **Kein Antialiasing, kein Rand.** Kapitalhöhe 7, x-Höhe 5, Unterlängen bis + Zeile 9. Ein 2-px-Strich in einer 6-px-Glyphe ist schon fett. diff --git a/art/final/Font/font8_10.fnt b/art/final/Font/font8_10.fnt new file mode 100644 index 0000000..14057bd --- /dev/null +++ b/art/final/Font/font8_10.fnt @@ -0,0 +1,97 @@ +info face="taloria8" size=10 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=0 aa=1 padding=0,0,0,0 spacing=0,0 outline=0 +common lineHeight=12 base=8 scaleW=128 scaleH=60 pages=1 packed=0 alphaChnl=0 redChnl=4 greenChnl=4 blueChnl=4 +page id=0 file="font8_10_atlas.png" +chars count=93 +char id=32 x=0 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=33 x=8 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=34 x=16 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=37 x=24 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=38 x=32 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=39 x=40 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=40 x=48 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=41 x=56 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=42 x=64 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=43 x=72 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=44 x=80 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=45 x=88 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=46 x=96 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=47 x=104 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=48 x=112 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=49 x=120 y=0 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=50 x=0 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=51 x=8 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=52 x=16 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=53 x=24 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=54 x=32 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=55 x=40 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=56 x=48 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=57 x=56 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=58 x=64 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=59 x=72 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=60 x=80 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=61 x=88 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=62 x=96 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=63 x=104 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=65 x=112 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=66 x=120 y=10 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=67 x=0 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=68 x=8 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=69 x=16 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=70 x=24 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=71 x=32 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=72 x=40 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=73 x=48 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=74 x=56 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=75 x=64 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=76 x=72 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=77 x=80 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=78 x=88 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=79 x=96 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=80 x=104 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=81 x=112 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=82 x=120 y=20 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=83 x=0 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=84 x=8 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=85 x=16 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=86 x=24 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=87 x=32 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=88 x=40 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=89 x=48 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=90 x=56 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=91 x=64 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=93 x=72 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=97 x=80 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=98 x=88 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=99 x=96 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=100 x=104 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=101 x=112 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=102 x=120 y=30 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=103 x=0 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=104 x=8 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=105 x=16 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=106 x=24 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=107 x=32 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=108 x=40 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=109 x=48 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=110 x=56 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=111 x=64 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=112 x=72 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=113 x=80 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=114 x=88 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=115 x=96 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=116 x=104 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=117 x=112 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=118 x=120 y=40 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=119 x=0 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=120 x=8 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=121 x=16 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=122 x=24 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=196 x=32 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=214 x=40 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=220 x=48 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=223 x=56 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=228 x=64 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=246 x=72 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=252 x=80 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=8211 x=88 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 +char id=8212 x=96 y=50 width=8 height=10 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=15 diff --git a/art/final/Font/font8_10_2x.fnt b/art/final/Font/font8_10_2x.fnt new file mode 100644 index 0000000..0080bea --- /dev/null +++ b/art/final/Font/font8_10_2x.fnt @@ -0,0 +1,97 @@ +info face="taloria8" size=20 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=0 aa=1 padding=0,0,0,0 spacing=0,0 outline=0 +common lineHeight=24 base=16 scaleW=256 scaleH=120 pages=1 packed=0 alphaChnl=0 redChnl=4 greenChnl=4 blueChnl=4 +page id=0 file="font8_10_atlas_2x.png" +chars count=93 +char id=32 x=0 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=33 x=16 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=34 x=32 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=37 x=48 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=38 x=64 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=39 x=80 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=40 x=96 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=41 x=112 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=42 x=128 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=43 x=144 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=44 x=160 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=45 x=176 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=46 x=192 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=47 x=208 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=48 x=224 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=49 x=240 y=0 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=50 x=0 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=51 x=16 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=52 x=32 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=53 x=48 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=54 x=64 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=55 x=80 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=56 x=96 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=57 x=112 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=58 x=128 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=59 x=144 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=60 x=160 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=61 x=176 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=62 x=192 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=63 x=208 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=65 x=224 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=66 x=240 y=20 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=67 x=0 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=68 x=16 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=69 x=32 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=70 x=48 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=71 x=64 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=72 x=80 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=73 x=96 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=74 x=112 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=75 x=128 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=76 x=144 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=77 x=160 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=78 x=176 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=79 x=192 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=80 x=208 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=81 x=224 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=82 x=240 y=40 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=83 x=0 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=84 x=16 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=85 x=32 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=86 x=48 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=87 x=64 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=88 x=80 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=89 x=96 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=90 x=112 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=91 x=128 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=93 x=144 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=97 x=160 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=98 x=176 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=99 x=192 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=100 x=208 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=101 x=224 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=102 x=240 y=60 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=103 x=0 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=104 x=16 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=105 x=32 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=106 x=48 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=107 x=64 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=108 x=80 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=109 x=96 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=110 x=112 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=111 x=128 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=112 x=144 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=113 x=160 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=114 x=176 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=115 x=192 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=116 x=208 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=117 x=224 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=118 x=240 y=80 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=119 x=0 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=120 x=16 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=121 x=32 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=122 x=48 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=196 x=64 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=214 x=80 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=220 x=96 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=223 x=112 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=228 x=128 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=246 x=144 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=252 x=160 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=8211 x=176 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 +char id=8212 x=192 y=100 width=16 height=20 xoffset=0 yoffset=0 xadvance=16 page=0 chnl=15 diff --git a/art/final/Font/font8_10_atlas.png b/art/final/Font/font8_10_atlas.png new file mode 100644 index 0000000..8b218de Binary files /dev/null and b/art/final/Font/font8_10_atlas.png differ diff --git a/art/final/Font/font8_10_atlas_2x.png b/art/final/Font/font8_10_atlas_2x.png new file mode 100644 index 0000000..5e07fea Binary files /dev/null and b/art/final/Font/font8_10_atlas_2x.png differ diff --git a/art/final/Pictures/README.md b/art/final/Pictures/README.md index 3f0db9a..8f2d7c5 100644 --- a/art/final/Pictures/README.md +++ b/art/final/Pictures/README.md @@ -1,13 +1,11 @@ # Pictures -> **Arbeitsstand 12.11.2026, bewusst nicht nachgezogen:** Die Dateien hier sind -> mit 4× aus der alten 320×180-Basis erzeugt, verbindlich ist **640×360 Basis, -> 2×** ([`../../WORKFLOW.md`](../../WORKFLOW.md) §0). Anders als bei Kacheln und -> Sprites rettet hier keine Halbierung: die 320er Basis steckt im Bild selbst, -> also fehlt Detail, das nur ein Neulauf aus dem Rohbild liefert -> (`--size 640x360 --upscale 2`). Der Nachlauf der übrigen Kategorien ist -> erledigt; dieser hier steht noch aus -> ([`../../../docs/roadmap.md`](../../../docs/roadmap.md) §0.0). +> **Stand 15.11.2026:** Die vier Bilder sind aus den Rohbildern **neu gerechnet** +> (`--size 640x360 --upscale 2`) — bei Kacheln und Sprites war der Nachlauf eine +> Halbierung, hier nicht: die 320er Basis steckte im Bild selbst, ein Halbieren +> hätte nur das alte Detail weggeworfen. Verbindlich ist **640×360 Basis, 2×** +> ([`../../WORKFLOW.md`](../../WORKFLOW.md) §0); der Nachlauf ist damit +> abgeschlossen ([`../../../docs/roadmap.md`](../../../docs/roadmap.md) §0.0). Vollbilder für **Titel, Kapitel und Illustrationen** — **mit oder ohne Figuren**. Seit der Draufsicht-Entscheidung (14.11.2026) ist `Pictures/` nicht @@ -17,8 +15,8 @@ Kapitelbilder, Zwischenbilder und Illustrationen. | | | |---|---| -| Basisgröße | **320x180** | -| Ausgabe | 1280x720 (4× nearest) | +| Basisgröße | **640x360** | +| Ausgabe | 1280x720 (2× nearest) | | Stil | Richtung **B** (gemalt) | | Alpha | nein, deckend | @@ -26,22 +24,22 @@ Kapitelbilder, Zwischenbilder und Illustrationen. ```bash python3 ../../tools/pixelize.py ../../raw/Pictures/.png \ - -o _1280x720.png --size 320x180 --colors 64 --levels 0.5 --gamma 1.3 --upscale 4 + -o _1280x720.png --size 640x360 --colors 64 --levels 0.5 --gamma 1.3 --upscale 2 ``` ## Inhalt | Datei | Rohbild | Seed | Aufruf | |---|---|---|---| -| `szene_waffenhaendler_1280x720.png` | `raw/Pictures/szene_waffenhaendler_v2_seed512733.png` | 512733 | `--size 320x180 --colors 64 --levels 0.5 --gamma 1.3 --upscale 4` | -| `taverne_B_1280x720.png` | `raw/Pictures/szene_taverne_B_seed771102.png` | 771102 | `--size 320x180 --colors 64 --levels 0.5 --gamma 1.3 --upscale 4` | -| `taverne_A_1280x720.png` | `raw/Pictures/szene_taverne_flux2_gpu_seed771102.png` | 771102 | `--size 320x180 --colors 32 --upscale 4` (leer, Richtung A) | -| `waldrand_1280x720.png` | `raw/Pictures/terrain_waldrand_s90210.png` | 90210 | `--size 320x180 --colors 64 --levels 0.5 --gamma 1.3 --upscale 4` | +| `szene_waffenhaendler_1280x720.png` | `raw/Pictures/szene_waffenhaendler_v2_seed512733.png` | 512733 | `--size 640x360 --colors 64 --levels 0.5 --gamma 1.3 --upscale 2` | +| `taverne_B_1280x720.png` | `raw/Pictures/szene_taverne_B_seed771102.png` | 771102 | `--size 640x360 --colors 64 --levels 0.5 --gamma 1.3 --upscale 2` | +| `taverne_A_1280x720.png` | `raw/Pictures/szene_taverne_flux2_gpu_seed771102.png` | 771102 | `--size 640x360 --colors 32 --upscale 2` (leer, Richtung A) | +| `waldrand_1280x720.png` | `raw/Pictures/terrain_waldrand_s90210.png` | 90210 | `--size 640x360 --colors 64 --levels 0.5 --gamma 1.3 --upscale 2` | ## Regeln - **`--levels 0.5 --gamma 1.3` ist Pflicht** bei Nacht- und Innenszenen: ohne Tonwertspreizung fällt die halbe Fläche auf Schwarz zusammen. -- Kein Dithering global — bei 320×180 wirkt es als Filter (siehe +- Kein Dithering global — bei dieser Motivgröße wirkt es als Filter (siehe `../../WORKFLOW.md` §4.3). - Neue Datei → Zeile in der Tabelle oben (Name, Seed, Rohdatei). diff --git a/art/final/Pictures/szene_waffenhaendler_1280x720.png b/art/final/Pictures/szene_waffenhaendler_1280x720.png index d315325..9dd3f7d 100644 Binary files a/art/final/Pictures/szene_waffenhaendler_1280x720.png and b/art/final/Pictures/szene_waffenhaendler_1280x720.png differ diff --git a/art/final/Pictures/taverne_A_1280x720.png b/art/final/Pictures/taverne_A_1280x720.png index aeb34d3..cbde7ee 100644 Binary files a/art/final/Pictures/taverne_A_1280x720.png and b/art/final/Pictures/taverne_A_1280x720.png differ diff --git a/art/final/Pictures/taverne_B_1280x720.png b/art/final/Pictures/taverne_B_1280x720.png index 127d0ff..0ab97db 100644 Binary files a/art/final/Pictures/taverne_B_1280x720.png and b/art/final/Pictures/taverne_B_1280x720.png differ diff --git a/art/final/Pictures/waldrand_1280x720.png b/art/final/Pictures/waldrand_1280x720.png index db88ae4..8cba2d9 100644 Binary files a/art/final/Pictures/waldrand_1280x720.png and b/art/final/Pictures/waldrand_1280x720.png differ diff --git a/art/final/UI/README.md b/art/final/UI/README.md index 05ce0f0..4a70bbc 100644 --- a/art/final/UI/README.md +++ b/art/final/UI/README.md @@ -10,7 +10,7 @@ Zauberbuch-Raster, Party-Rahmen, Balken, Tooltips, Ladebalken. | Stil | Richtung **A** (flach) | | Palette | **16 Farben fest**, Anker `_palette_ui.png` | | Alpha | teils — Panels liegen mit Alpha über der Karte | -| Schrift | **8×10** aus [`../../tools/font8.py`](../../tools/font8.py), Vorschub 8, Zeile 12 | +| Schrift | **8×10** aus [`../../tools/font8.py`](../../tools/font8.py), Vorschub 8, Zeile 12; Engine-Fassung in [`../Font/`](../Font/) | **Diese Kategorie läuft nicht über `pixelize.py` und nicht über ein Modell.** UI ist Linienarbeit: ein 1-px-Bevel ist eine exakte Pixelzeile, und ein @@ -46,8 +46,16 @@ mehr auf das Raster zu bringen. | `ui_kampf_leiste_400x56.png` | 400×56 | Initiative-Reihe + sechs Aktionen | | `ui_misc_220x130.png` | 220×130 | Balken HP/SP/MP, Checkbox, Slider, Tooltip, Cursor | | `ui_ladebalken_240x26.png` | 240×26 | Ladebalken mit Segmentmarken und Prozentwert | +| `ui_panel_9slice_12px.png` | 12×12 | 9-Slice-Vorlage: Rand 2 px (1×) / 4 px (2×), innen flach | | `_palette_ui.png` | 32×32 | 16 Farben als 4×4-Raster, `--palette`-Anker | +Das **9-Slice-Panel** ist seit 15.11. dabei: dieselben zwei Linien wie `panel()` +in `ui.py`, aber als dehnbare Textur für `NinePatchRect`. Dass es in jeder +Größe pixelgleich zu `panel()` ist, prüft +[`../../tools/ui_slice.py`](../../tools/ui_slice.py) (Belegblatt in +[`../../prep/ui-slice/`](../../prep/ui-slice/)). Regel und Maße: +[`../../../docs/ui.md`](../../../docs/ui.md) §3. + Die Porträts in `ui_party_40px.png` kommen aus [`../Players/portrait_*_32px.png`](../Players/portrait_*_32px.png); im Spiel komponiert die Engine sie in den Rahmen. @@ -98,11 +106,12 @@ Umbra) — UI und Bild sollen nicht zwei Welten sein. ## Offen -- **Neun-Slice.** Panels sind derzeit feste Größen (390, 170, 400 px). Für - variable Textboxen braucht es 9-Slice-Ränder (Ecken 4×4, Kanten 1 px) plus - Regel, wie der Inhalt einrückt. -- **Font für die Engine.** Der 8×10-Satz steht in `tools/font8.py`; offen ist - der Export als `FontFile`/BMFont oder Textur-Atlas. +- ~~**Neun-Slice.**~~ → **erledigt 15.11.2026**: `ui_panel_9slice_12px.png`, + Rand 2 px (1×). Offen ist nur noch die **Einrückung des Inhalts** — wieviel + Abstand ein Text von der Kante bekommt (Richtwert 5 px wie im Dialog), das + entscheidet der erste echte Dialog in der Engine. +- ~~**Font für die Engine.**~~ → **erledigt 15.11.2026**, siehe + [`../Font/`](../Font/). - **Interaktionszustände** für Listen: Scrollbalken, Hover, Tooltip mit variabler Breite, Mauszeiger-Varianten. - **Noch nicht gebaut:** Kartenrand, Kapitel-/Titelbild-Rahmen, Kampf-Log als diff --git a/art/final/UI/ui_panel_9slice_12px.png b/art/final/UI/ui_panel_9slice_12px.png new file mode 100644 index 0000000..e6c0bca Binary files /dev/null and b/art/final/UI/ui_panel_9slice_12px.png differ diff --git a/art/final/UI/ui_window_zauber_170x140.png b/art/final/UI/ui_window_zauber_170x140.png index 414283a..38b23cd 100644 Binary files a/art/final/UI/ui_window_zauber_170x140.png and b/art/final/UI/ui_window_zauber_170x140.png differ diff --git a/art/final/_referenz.png b/art/final/_referenz.png new file mode 100644 index 0000000..381a585 Binary files /dev/null and b/art/final/_referenz.png differ diff --git a/art/prep/font8/_alphabet_4x.png b/art/prep/font8/_alphabet_4x.png index 88a3770..3fa703f 100644 Binary files a/art/prep/font8/_alphabet_4x.png and b/art/prep/font8/_alphabet_4x.png differ diff --git a/art/prep/font8/_bmfont_probe.png b/art/prep/font8/_bmfont_probe.png new file mode 100644 index 0000000..9e63891 Binary files /dev/null and b/art/prep/font8/_bmfont_probe.png differ diff --git a/art/prep/font8/_bmfont_probe_2x.png b/art/prep/font8/_bmfont_probe_2x.png new file mode 100644 index 0000000..53f5448 Binary files /dev/null and b/art/prep/font8/_bmfont_probe_2x.png differ diff --git a/art/prep/font8/_probe_1280x720.png b/art/prep/font8/_probe_1280x720.png index 563c201..b831e21 100644 Binary files a/art/prep/font8/_probe_1280x720.png and b/art/prep/font8/_probe_1280x720.png differ diff --git a/art/prep/font8/_probe_640x360.png b/art/prep/font8/_probe_640x360.png index 9e798f5..b2c0071 100644 Binary files a/art/prep/font8/_probe_640x360.png and b/art/prep/font8/_probe_640x360.png differ diff --git a/art/prep/ui-slice/_panel_probe_420x212.png b/art/prep/ui-slice/_panel_probe_420x212.png new file mode 100644 index 0000000..697459c Binary files /dev/null and b/art/prep/ui-slice/_panel_probe_420x212.png differ diff --git a/art/prep/ui-slice/_panel_probe_840x424.png b/art/prep/ui-slice/_panel_probe_840x424.png new file mode 100644 index 0000000..8f266ea Binary files /dev/null and b/art/prep/ui-slice/_panel_probe_840x424.png differ diff --git a/art/tools/font8.py b/art/tools/font8.py index 8db978b..a49ef27 100644 --- a/art/tools/font8.py +++ b/art/tools/font8.py @@ -218,8 +218,10 @@ GLYPHS: dict[str, str] = { "#....#", "#....#", ".####.", "......", "......"), "ü": _g("......", ".#..#.", "......", "#....#", "#....#", "#....#", "#....#", ".####.", "......", "......"), - "ß": _g("......", ".###..", "#...#.", "#...#.", ".###..", - "#...#.", "#...#.", "####..", "......", "......"), + # ß: langer Stamm links, oben und unten je ein Bogen. Ohne den Stamm + # liest die Form bei 6 px als § (vorher so gesetzt, am 15.11. korrigiert). + "ß": _g("......", ".#.##.", ".##..#", ".#...#", ".#.##.", + ".#...#", ".#...#", ".####.", "......", "......"), } FALLBACK = GLYPHS["?"] diff --git a/art/tools/font_export.py b/art/tools/font_export.py new file mode 100644 index 0000000..835fb35 --- /dev/null +++ b/art/tools/font_export.py @@ -0,0 +1,181 @@ +#!/usr/bin/env python3 +"""font_export.py - 8x10-Pixelsatz als Engine-Font (BMFont + Textur-Atlas). + +`font8.py` haelt den Satz als Python-Daten; Godot braucht eine Datei. Dieses +Werkzeug schreibt beides in `final/Font/`: + + font8_10_atlas.png Textur, Glyphen weiss auf transparent (1x) + font8_10.fnt BMFont-Textformat, Zeigt auf die 1x-Textur + font8_10_2x.fnt dasselbe in 2x (eigene Textur, eigene Metriken) + font8_10_atlas_2x.png + + python3 tools/font_export.py # schreiben + pruefen + python3 tools/font_export.py --check # nur pruefen + +Metriken (1x): Zelle 8x10, Vorschub 8, Zeile 12, Basislinie 8. In der 2x-Fassung +sind alle Werte verdoppelt; das Bild ist nearest-skaliert, also pixelgleich. + +**Pruefung ohne Godot:** `--check` liest die geschriebene .fnt mit einem eigenen +Parser, setzt daraus Text zusammen und vergleicht das Ergebnis Pixel fuer Pixel +mit `font8.draw_text`. Weicht etwas ab, ist die Datei falsch — nicht erst in +der Engine. +""" +from __future__ import annotations + +import argparse +import re +import sys +from pathlib import Path + +from PIL import Image, ImageDraw + +ART = Path(__file__).resolve().parent.parent +sys.path.insert(0, str(ART / "tools")) +import font8 # noqa: E402 + +ZELLE_W = 8 # Atlas-Zelle: 6 Spalten Glyphe + 2 Spalten Luft +ZELLE_H = font8.ROWS # 10 +SPALTEN = 16 # Glyphen pro Atlas-Zeile + + +def atlas(scale: int = 1) -> tuple[Image.Image, dict[str, tuple[int, int]]]: + """Glyphenraster bauen; liefert Bild und Position je Zeichen.""" + zeichen = sorted(font8.GLYPHS) + zeilen = (len(zeichen) + SPALTEN - 1) // SPALTEN + im = Image.new("RGBA", (SPALTEN * ZELLE_W, zeilen * ZELLE_H), (0, 0, 0, 0)) + px = im.load() + pos: dict[str, tuple[int, int]] = {} + for i, ch in enumerate(zeichen): + gx, gy = (i % SPALTEN) * ZELLE_W, (i // SPALTEN) * ZELLE_H + pos[ch] = (gx, gy) + for row, zeile in enumerate(font8.GLYPHS[ch].split("/")): + for col, p in enumerate(zeile): + if p == "#": + # +1: font8.draw_text setzt die Glyphe auf x+rx+1, also mit + # 1 px linkem Vorlauf in der 8-px-Zelle. + px[gx + col + 1, gy + row] = (255, 255, 255, 255) + if scale > 1: + im = im.resize((im.width * scale, im.height * scale), Image.NEAREST) + return im, pos + + +def fnt(scale: int, bild: str) -> str: + """BMFont-Textformat (angelcode). Alle Masse in Pixeln dieser Fassung.""" + zeichen = sorted(font8.GLYPHS) + s = scale + zeilen = [ + f'info face="taloria8" size={font8.ROWS * s} bold=0 italic=0 charset="" ' + f"unicode=1 stretchH=100 smooth=0 aa=1 padding=0,0,0,0 spacing=0,0 outline=0", + f"common lineHeight={font8.LINE * s} base={8 * s} scaleW={SPALTEN * ZELLE_W * s} " + f"scaleH={(len(zeichen) + SPALTEN - 1) // SPALTEN * ZELLE_H * s} pages=1 " + f"packed=0 alphaChnl=0 redChnl=4 greenChnl=4 blueChnl=4", + f'page id=0 file="{bild}"', + f"chars count={len(zeichen)}", + ] + for i, ch in enumerate(zeichen): + gx, gy = (i % SPALTEN) * ZELLE_W * s, (i // SPALTEN) * ZELLE_H * s + zeilen.append( + f"char id={ord(ch)} x={gx} y={gy} width={ZELLE_W * s} height={ZELLE_H * s} " + f"xoffset=0 yoffset=0 xadvance={font8.ADVANCE * s} page=0 chnl=15") + return "\n".join(zeilen) + "\n" + + +def lies_fnt(pfad: Path) -> dict: + """Minimaler BMFont-Leser (nur was zum Pruefen gebraucht wird).""" + text = pfad.read_text() + m = re.search(r"lineHeight=(\d+) base=(\d+)", text) + kopf = {"lineHeight": int(m.group(1)), "base": int(m.group(2))} + chars = {} + for zeile in text.splitlines(): + if not zeile.startswith("char id="): + continue + f = dict(re.findall(r"(\w+)=(-?\d+)", zeile)) + chars[chr(int(f["id"]))] = {k: int(v) for k, v in f.items()} + seite = re.search(r'page id=0 file="([^"]+)"', text).group(1) + return {"kopf": kopf, "chars": chars, "seite": seite, "dir": pfad.parent} + + +def setze(text: str, f: dict, breite: int, hoehe: int) -> Image.Image: + """Text nur mit den .fnt-Metriken setzen (kein font8, kein ui).""" + bild = Image.open(f["dir"] / f["seite"]).convert("RGBA") + im = Image.new("RGBA", (breite, hoehe), (0, 0, 0, 0)) + x = y = 0 + for ch in text: + if ch == "\n": + x, y = 0, y + f["kopf"]["lineHeight"] + continue + c = f["chars"].get(ch) or f["chars"]["?"] + teil = bild.crop((c["x"], c["y"], c["x"] + c["width"], c["y"] + c["height"])) + im.alpha_composite(teil, (x + c["xoffset"], y + c["yoffset"])) + x += c["xadvance"] + return im + + +def alle_zeichen(pro_zeile: int = 40) -> list[str]: + """Alle Glyphen des Satzes, in Zeilen umbrochen — fuer die Vollpruefung.""" + zs = sorted(font8.GLYPHS) + return ["".join(zs[i:i + pro_zeile]) for i in range(0, len(zs), pro_zeile)] + + +def pruefen(out: Path, skalierung: int = 1) -> list[str]: + probe = alle_zeichen() + name = "font8_10.fnt" if skalierung == 1 else "font8_10_2x.fnt" + f = lies_fnt(out / name) + + breite = max(font8.text_width(t) for t in probe) + 8 + hoehe = len(probe) * font8.LINE + klein = Image.new("RGBA", (breite, hoehe), (0, 0, 0, 0)) + d = ImageDraw.Draw(klein) + for i, zeile in enumerate(probe): + font8.draw_text(d, 0, i * font8.LINE, zeile, (255, 255, 255, 255)) + soll = (klein if skalierung == 1 else + klein.resize((breite * skalierung, hoehe * skalierung), Image.NEAREST)) + + ist = setze("\n".join(probe), f, soll.width, soll.height) + return [] if ist.tobytes() == soll.tobytes() else [ + f"{name}: gesetzter Text weicht von font8.draw_text ab"] + + +def main(argv: list[str] | None = None) -> int: + ap = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + ap.add_argument("--check", action="store_true", help="nur pruefen") + ap.add_argument("--out", type=Path, default=ART / "final" / "Font") + a = ap.parse_args(argv) + out = a.out + + if not a.check: + out.mkdir(parents=True, exist_ok=True) + for s in (1, 2): + bild, _ = atlas(s) + png = f"font8_10_atlas{'' if s == 1 else '_2x'}.png" + fntname = f"font8_10{'' if s == 1 else '_2x'}.fnt" + bild.save(out / png) + (out / fntname).write_text(fnt(s, png)) + print(f" {png:26s} {bild.width}x{bild.height}") + print(f" {fntname:26s} {len(font8.GLYPHS)} Zeichen") + + # Belegbild: derselbe Satz, aber ueber die .fnt gesetzt (nicht font8) + f = lies_fnt(out / "font8_10.fnt") + zeilen = ["Der Ghul greift an. ÄÖÜäöüß", + "Valyria zahlt 5 % in Ferrum —", + "Was wollt Ihr in Garana?"] + w = max(font8.text_width(z) for z in zeilen) + 10 + h = len(zeilen) * font8.LINE + 8 + blatt = Image.new("RGBA", (w, h), (58, 47, 39, 255)) + blatt.alpha_composite(setze("\n".join(zeilen), f, w, h), (5, 4)) + bild_out = ART / "prep" / "font8" + bild_out.mkdir(parents=True, exist_ok=True) + blatt.save(bild_out / "_bmfont_probe.png") + blatt.resize((w * 2, h * 2), Image.NEAREST).save( + bild_out / "_bmfont_probe_2x.png") + print(f" {bild_out}/_bmfont_probe.png (aus der .fnt gesetzt)") + + fehler = pruefen(out, 1) + pruefen(out, 2) + for f in fehler: + print(" ", f, file=sys.stderr) + print("\nPruefung:", "bestanden" if not fehler else "FEHLGESCHLAGEN") + return 1 if fehler else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/art/tools/referenz.py b/art/tools/referenz.py new file mode 100644 index 0000000..689fc4b --- /dev/null +++ b/art/tools/referenz.py @@ -0,0 +1,138 @@ +#!/usr/bin/env python3 +"""referenz.py - Referenzblatt: je Kategorie 2-5 freigegebene Assets. + +Das Blatt ist der **Maßstab** (Roadmap 0.1): ab hier entscheidet nicht der +Geschmack des Tages, sondern der Vergleich mit diesen Bildern — Palette, +Kontur, Größe, Strichstärke. + + python3 tools/referenz.py # -> final/_referenz_1280x...png + python3 tools/referenz.py --out /tmp/x + +Gezeichnet bei 2x (Auslieferungsmaßstab), damit die Pixel sichtbar sind. +Kein Modell, kein pixelize — nur `alpha_composite` aus `final/`. +""" +from __future__ import annotations + +import argparse +import sys +from pathlib import Path + +from PIL import Image, ImageDraw + +ART = Path(__file__).resolve().parent.parent +sys.path.insert(0, str(ART / "tools")) +import ui # noqa: E402 + +FINAL = ART / "final" +W = 1280 +RAND = 8 +ZEILE = 30 # Abstand zwischen zwei Kategorien + + +def lade(p: Path, faktor: int = 1) -> Image.Image: + im = Image.open(p).convert("RGBA") + return im.resize((im.width * faktor, im.height * faktor), Image.NEAREST) + + +class Blatt: + def __init__(self) -> None: + self.y = 34 + self.bild = Image.new("RGBA", (W, 1700), ui.alpha(ui.INK)) + self.d = ImageDraw.Draw(self.bild) + + def kopf(self, text: str, note: str = "") -> None: + ui.draw_text(self.d, RAND, self.y, text, ui.OCHRE) + if note: + ui.draw_text(self.d, RAND + 8 * (len(text) + 3), self.y, note, + ui.CREAM_D) + self.y += 16 + + def reihe(self, bilder: list[Image.Image], gap: int = 6) -> None: + hoehe = max(b.height for b in bilder) + x = RAND + for b in bilder: + self.bild.alpha_composite(b, (x, self.y + (hoehe - b.height) // 2)) + x += b.width + gap + self.y += hoehe + ZEILE + + def zeile(self, text: str) -> None: + ui.draw_text(self.d, RAND, self.y, text, ui.CREAM_D) + self.y += 14 + + def fertig(self, pfad: Path) -> None: + hoehe = self.y + RAND + assert hoehe <= self.bild.height, "Blatt zu klein: Canvas erhoehen" + im = self.bild.crop((0, 0, W, hoehe)) + im.save(pfad) + print(f"{pfad} {im.width}x{im.height} (2x-Maßstab)") + + +def main(argv: list[str] | None = None) -> int: + ap = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + ap.add_argument("--out", type=Path, default=FINAL / "_referenz.png") + a = ap.parse_args(argv) + + b = Blatt() + ui.draw_text(b.d, RAND, 8, "TALORIA - REFERENZBLATT", ui.CREAM) + ui.draw_text(b.d, RAND + 8 * 24, 8, "1X-MASSE, HIER 2X GEZEIGT / 15.11.2026", + ui.CREAM_D) + + b.kopf("TERRAIN", "32 PX, 12 FARBEN, NAHTLOS") + b.reihe([lade(FINAL / "Terrain" / f) for f in ( + "tile_grasland_32px.png", "tile_steppe_32px.png", "tile_wald_32px.png", + "tile_huegel_32px.png", "tile_gebirge_32px.png")]) + + b.kopf("SCHLACHTFELD / STADT / DUNGEON", "DIESELBEN 32 PX, FLACH STATT SYMBOL") + b.reihe([lade(FINAL / "Terrain" / f) for f in ( + "battle_gras_32px.png", "battle_erde_32px.png", "battle_stein_32px.png", + "tile_wand_stein_32px.png", "tile_dach_fachwerk_32px.png")]) + + b.kopf("OBJECTS", "32 PX, KONTUR 1 PX, AUF DUNKLEM GRUND GEPRUEFT") + b.reihe([lade(FINAL / "Objects" / f) for f in ( + "objekt_schwert_32px.png", "objekt_truhe_32px.png", + "objekt_fass_32px.png", "objekt_tisch_32px.png", "objekt_tuer_32px.png", + "objekt_fackel_32px.png", "objekt_brunnen_32px.png")]) + + b.kopf("NSC", "32X40, TOP-DOWN, KONTUR 1 PX") + b.reihe([lade(FINAL / "NPCs" / f) for f in ( + "nsc_wache_32px.png", "nsc_haendler_32px.png", "nsc_druide_32px.png", + "nsc_dorfbewohner_32px.png", "nsc_dorfbewohnerin_32px.png", + "nsc_bettler_32px.png")]) + + b.kopf("CREATURES", "96ER-CANVAS; ZEICHNUNG 56 RATTE / 72 GOBLIN / 96 REST") + b.reihe([lade(FINAL / "Creatures" / f) for f in ( + "monster_ratte_96px.png", "monster_goblin_96px.png", + "monster_wolf_96px.png", "monster_orc_96px.png", + "monster_skelett_96px.png", + "monster_spinne_96px.png")], gap=2) + + b.kopf("PLAYERS", "FIGUR 64X80, PORTRAET 32X32 (HIER 2X)") + b.reihe([lade(FINAL / "Players" / f) for f in ( + "player_abenteurer_64px.png", "portrait_krieger_32px.png", + "portrait_magierin_32px.png", "portrait_zwerg_32px.png", + "portrait_elfin_32px.png")]) + + b.kopf("UI", "16 FARBEN, 8X10-SCHRIFT, BEVEL 1 PX") + b.reihe([lade(FINAL / "UI" / f) for f in ( + "ui_buttons_64x18.png", "ui_slots_26px.png", + "ui_panel_9slice_12px.png")]) + + b.zeile("DIALOG 390X71 UND KAMPF-LEISTE 400X56 SIND ZU BREIT FUER DIESE SPALTE -") + b.zeile("SIE STEHEN IN prep/map-mock/ UND prep/battle-mock/ UEBER ECHTEN KARTEN.") + b.y += 10 + + b.kopf("SCHRIFT", "8X10, VORSCHUB 8, ZEILE 12") + ui.draw_text(b.d, RAND, b.y, + "DER GHUL GREIFT AN. PRUEFE DIE ZOELLE IN GARANA - 5 %.", + ui.CREAM) + b.y += 14 + ui.draw_text(b.d, RAND, b.y, "ÄÖÜäöüß 0123456789 !?%&*()[]<>=/+-", ui.CREAM_D) + b.y += 18 + b.zeile("PALETTEN: PALETTE-TILES / PALETTE-BATTLE / PALETTE-UI (PNG IM JEWEILIGEN ORDNER)") + + b.fertig(a.out) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/art/tools/ui.py b/art/tools/ui.py index a5a2a71..a748219 100644 --- a/art/tools/ui.py +++ b/art/tools/ui.py @@ -85,6 +85,26 @@ def panel(d, box, fill=PANEL, line=LINE, bevel=True): return d +PANEL_SLICE = 2 # Rand des 9-Slice in Pixeln (1x): 1 px Rahmen + 1 px Bevel + + +def elem_panel_slice(size: int = 12) -> Image.Image: + """9-Slice-Vorlage eines Panels — 2-px-Rand, innen flache Füllung. + + Der Rand ist genau das, was `panel()` an den vier Seiten zeichnet: außen + 1 px `LINE`, innen 1 px Bevel (`PANEL_HI` oben/links, `PANEL_LO` + unten/rechts). Der Kern ist die Fläche `PANEL` und damit einfarbig — + dehnbar ohne Verlust. + + Für die Engine: `NinePatchRect` mit `patch_margin_*` = 2 (bei dieser 1×- + Textur), bzw. 4 auf der 2×-Datei. Ergebnis ist pixelgleich zu `panel()` + in jeder Größe ab 4×4; geprüft mit `tools/ui_slice.py`. + """ + im = Image.new("RGBA", (size, size), (0, 0, 0, 0)) + panel(ImageDraw.Draw(im), (0, 0, size - 1, size - 1)) + return im + + def well(d, box, fill=PANEL_LO): """Vertiefte Fläche: dunkel oben/links, Licht unten/rechts.""" x0, y0, x1, y1 = box @@ -511,6 +531,7 @@ def main(argv=None) -> None: "ui_misc_220x130": elem_misc(), "ui_kampf_leiste_400x56": elem_combat(), "ui_ladebalken_240x26": elem_loadbar(), + "ui_panel_9slice_12px": elem_panel_slice(), } for name, im in elements.items(): save(im, a.out, name, a.scale) diff --git a/art/tools/ui_slice.py b/art/tools/ui_slice.py new file mode 100644 index 0000000..599a2f1 --- /dev/null +++ b/art/tools/ui_slice.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python3 +"""ui_slice.py - 9-Slice-Panel aus ui.py pruefen und als Blatt zeigen. + +`tools/ui.py` zeichnet Panels prozedural (`panel()`). Fuer die Engine wird +dasselbe als **9-Slice-Textur** ausgeliefert +(`final/UI/ui_panel_9slice_12px.png`, Rand 2 px bei 1x), damit ein +`NinePatchRect` in Godot jedes Fenster ohne eigene Zeichenroutine fuellt. + +Dieses Werkzeug beweist, dass die Textur stimmt: es setzt Panels aus den neun +Teilen zusammen und vergleicht sie Pixel fuer Pixel mit `panel()`. + + python3 tools/ui_slice.py # pruefen + Blatt nach prep/ui-slice/ + python3 tools/ui_slice.py --check # nur pruefen (Exit 1 bei Abweichung) +""" +from __future__ import annotations + +import argparse +import sys +from pathlib import Path + +from PIL import Image, ImageDraw + +ART = Path(__file__).resolve().parent.parent +sys.path.insert(0, str(ART / "tools")) +import ui # noqa: E402 + +M = ui.PANEL_SLICE +# Groessen aus docs/ui.md: Dialog, Kampf-Log, Handelsfenster, Leiste, Minimum +GROESSEN = [(4, 4), (12, 12), (24, 16), (170, 132), (228, 56), (390, 71), + (400, 56)] + + +def neun(textur: Image.Image, w: int, h: int) -> Image.Image: + """Panel aus neun Teilen bauen, wie ein NinePatchRect es tut (nearest).""" + s = textur.width + m = M + out = Image.new("RGBA", (w, h), (0, 0, 0, 0)) + wm, hm = w - 2 * m, h - 2 * m + + def stueck(box, ziel, ziel_box) -> None: + teil = textur.crop(box) + if teil.size != ziel: + teil = teil.resize(ziel, Image.NEAREST) + out.paste(teil, ziel_box) + + # Ecken bleiben 1:1 + out.paste(textur.crop((0, 0, m, m)), (0, 0)) + out.paste(textur.crop((s - m, 0, s, m)), (w - m, 0)) + out.paste(textur.crop((0, s - m, m, s)), (0, h - m)) + out.paste(textur.crop((s - m, s - m, s, s)), (w - m, h - m)) + if wm > 0: + stueck((m, 0, s - m, m), (wm, m), (m, 0)) + stueck((m, s - m, s - m, s), (wm, m), (m, h - m)) + if hm > 0: + stueck((0, m, m, s - m), (m, hm), (0, m)) + stueck((s - m, m, s, s - m), (m, hm), (w - m, m)) + if wm > 0 and hm > 0: + stueck((m, m, s - m, s - m), (wm, hm), (m, m)) + return out + + +def soll(w: int, h: int) -> Image.Image: + im = Image.new("RGBA", (w, h), (0, 0, 0, 0)) + ui.panel(ImageDraw.Draw(im), (0, 0, w - 1, h - 1)) + return im + + +def main(argv: list[str] | None = None) -> int: + ap = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + ap.add_argument("--check", action="store_true", help="nur pruefen, kein Blatt") + a = ap.parse_args(argv) + + textur = ui.elem_panel_slice() + fehler = [] + for w, h in GROESSEN: + ist, ref = neun(textur, w, h), soll(w, h) + gleich = ist.tobytes() == ref.tobytes() + print(f" {w:4d}x{h:<4d} {'pixelgleich' if gleich else 'ABWEICHUNG'}") + if not gleich: + fehler.append(f"{w}x{h}") + + if not a.check: + blatt = Image.new("RGBA", (420, 212), (24, 20, 17, 255)) + d = ImageDraw.Draw(blatt) + ui.draw_text(d, 6, 4, "9-SLICE PANEL - GEGENPROBE", ui.OCHRE) + + # Reihe 1: die breite Dialogbox, Reihe 2: Log und Handelsfenster + ui.draw_text(d, 6, 16, "390x71", ui.CREAM_D) + blatt.alpha_composite(neun(textur, 390, 71), (6, 28)) + ui.draw_text(d, 6, 103, "228x56", ui.CREAM_D) + blatt.alpha_composite(neun(textur, 228, 56), (6, 115)) + ui.draw_text(d, 242, 103, "170x52", ui.CREAM_D) + blatt.alpha_composite(neun(textur, 170, 52), (242, 115)) + + ui.draw_text(d, 6, 178, f"TEXTUR {textur.width}x{textur.height}, RAND {M} PX (1X)", + ui.CREAM) + ui.draw_text(d, 6, 194, "GODOT: NINEPATCHRECT, MARGIN 2 (1X) / 4 (2X)", + ui.CREAM_D) + out = ART / "prep" / "ui-slice" + out.mkdir(parents=True, exist_ok=True) + blatt.save(out / "_panel_probe_420x212.png") + blatt.resize((840, 424), Image.NEAREST).save( + out / "_panel_probe_840x424.png") + print(f"{out}/_panel_probe_420x212.png (+2x)") + + if fehler: + print(f"\n{len(fehler)} Abweichungen: {', '.join(fehler)}", file=sys.stderr) + return 1 + print("\nAlle Groessen pixelgleich.") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/docs/roadmap.md b/docs/roadmap.md index 7376412..5f2321d 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -9,10 +9,11 @@ gebaut. --- -## Stand 14.11.2026 — Übergabe +## Stand 15.11.2026 — Phase 0 abgeschlossen -**Phase 0 ist entschieden und dokumentiert; Phase 1 (Godot) hat noch nicht -begonnen.** Der Stand liegt vollständig im Repo (committet und gepusht). +**Phase 0 ist entschieden, dokumentiert und abgeliefert; Phase 1 (Godot) hat +noch nicht begonnen.** Der Stand liegt vollständig im Repo (committet und +gepusht). | Bereich | Stand | |---|---| @@ -24,26 +25,37 @@ begonnen.** Der Stand liegt vollständig im Repo (committet und gepusht). | Regeln | OSE-ähnlich, Punktekauf, Volk + Klasse — [`systeme.md`](systeme.md) | | UI | 8×10, Elemente in 2×, Layout/Zustände — [`ui.md`](ui.md) | +### Erledigt am 15.11.2026 + +1. **2×-Nachlauf** — Terrain, Creatures, Players, NPCs und Objects halbiert + ([`../art/tools/nachlauf2x.py`](../art/tools/nachlauf2x.py), verlustfrei); + `Pictures/` als einzige Ausnahme aus den Rohbildern **neu gerechnet** + (`--size 640x360`). Alle Kategorien liegen jetzt in 2×. +2. **9-Slice-Panel** — `art/final/UI/ui_panel_9slice_12px.png` (Rand 2 px bei + 1×) ersetzt feste Panelgrößen; pixelgleich zu `panel()` für 4×4 bis 400×56, + geprüft von [`../art/tools/ui_slice.py`](../art/tools/ui_slice.py). + Siehe [`ui.md`](ui.md) §3. +3. **Font-Export** — der 8×10-Satz liegt als **BMFont** in + [`../art/final/Font/`](../art/final/Font/) (Atlas + `.fnt`, 1× und 2×). + Prüfung ohne Godot: alle 93 Zeichen werden aus der `.fnt` gesetzt und mit + `font8.draw_text` verglichen. +4. **Referenzblatt** — `art/final/_referenz.png` (1280 px breit, 2×-Maßstab): + je Kategorie 2–6 freigegebene Assets plus Schriftprobe. Ab jetzt ist das der + Maßstab, nicht der Geschmack des Tages. + ### Offen (Phase 0) -1. **9-Slice-Panels** — Dialoge sind feste Größen (390×71 / 390×107); - Handelsfenster, Kampf-Log und Kartenrand brauchen variable Panels. - Siehe [`ui.md`](ui.md) §7 und §0.2. -2. **Font-Export** — der 8×10-Satz liegt als Python-Daten - ([`../art/tools/font8.py`](../art/tools/font8.py)); für Godot fehlt - `FontFile`/BMFont oder ein Textur-Atlas. -3. **Referenzblatt** aus je 2–3 freigegebenen Assets pro Kategorie (0.1) — - ab dann ist es der Maßstab, nicht der Geschmack des Tages. -4. ~~**2×-Nachlauf**~~ — **erledigt 14.11.2026.** Terrain, Creatures, - Players, NPCs und Objects liegen jetzt in 2× vor - (`art/tools/nachlauf2x.py`, verlustfrei aus den 4×-Dateien). Ausnahme: - `art/final/Pictures/` ist mit `--size 320x180` gerechnet — das ist kein - Halbieren, sondern ein Neulauf aus dem Rohbild. +Nur noch Kleinigkeiten, die den Start von Phase 1 nicht blockieren: + +- **Weltpalette** als Datei (0.1) und **Kontrast-/Tonwertregel** schriftlich. +- **Interaktionszustände** für Listen: Scrollbalken, Hover, Tooltip. +- **NSC-Dialogporträts** (eigener Satz, 64×64) — die sechs Party-Porträts sind + ein anderer Pool. ### Nächster Schritt (Phase 1) 1. Godot-Projekt anlegen: 640×360 intern, nearest, ganzzahlig skalierend. -2. Font importieren (`tools/font8.py` → `FontFile` oder Atlas). +2. Font importieren (`art/final/Font/font8_10.fnt` → `FontFile`, 1× oder 2×). 3. UI-Bausteine: Panel, Dialogbox, Party-Spalte, Karten-Renderer. 4. Kartenwechsel (Overland ↔ Stadt ↔ Dungeon), Party-Daten, Speichern/Laden. @@ -154,8 +166,10 @@ Die Richtungsfrage ist entschieden (Hybrid, siehe 128 (Boss, eigene Canvas). Umgesetzt mit `pixelize.py --canvas 96x96`; Regel und Messwerte in [`art/final/Creatures/README.md`](../art/final/Creatures/README.md). -- [ ] **Referenzblatt** aus je 2–3 freigegebenen Assets pro Kategorie — - das ist ab dann der Maßstab, nicht der Geschmack des Tages. +- [x] **Referenzblatt** (15.11.2026): `art/final/_referenz.png`, erzeugt von + [`art/tools/referenz.py`](../art/tools/referenz.py) — je Kategorie 2–6 + freigegebene Assets bei 2×, mit Palette- und Schriftprobe. Ab jetzt ist + es der Maßstab, nicht der Geschmack des Tages. - [ ] **Weltpalette** als Datei (`art/final/Terrain/_palette_tiles.png` erweitern oder eine gemeinsame `_palette_world.png`): 16–32 Farben für A, 64 für B, UI-Anker separat. @@ -184,16 +198,19 @@ Fertig, wenn: ein fremdes Asset ohne Rückfrage in den Satz passt. - [x] **Screen-Layout im Basisraster festlegen** (14.11.2026): Karte, Party-Spalte 40×272, Dialog 390×71, Kampf 18×9 + Leiste 400×56 + Log 228×56 — alles in Pixeln in [`ui.md`](ui.md). -- [ ] **9-Slice-Ränder** für variable Panels (Dialog 3/6 Zeilen reicht nicht: - Handelsfenster, Kampf-Log, Kartenrand brauchen andere Maße). +- [x] **9-Slice-Ränder** (15.11.2026): `ui_panel_9slice_12px.png`, Rand 2 px + bei 1× (4 px in der 2×-Datei) — für Handelsfenster, Kampf-Log und + Kartenrand in beliebiger Größe. Maße und Godot-Anbindung in + [`ui.md`](ui.md) §3. - [x] **Fontgröße festlegen** (14.11.2026): **8×10** (Zelle 8×10, Vorschub 8, Zeile 12). In der 292-px-Box wären es 35 statt 47 Zeichen; die Box ist deshalb auf 390 px gewachsen und **alle Elemente sind neu gesetzt**. -- [ ] **Font als Engine-Font** (BMFont/`FontFile`), 8×10, inkl. Umlauten, `%`, - Ziffern, Satzzeichen und Zeilenumbruch-Regeln. Der Zeichensatz steht - (eigener Pixelsatz, [`art/tools/font8.py`](../art/tools/font8.py), - Probe in [`art/prep/font8/`](../art/prep/font8/)); offen ist nur der - Engine-Export. Der Neusatz der Elemente ist erledigt. +- [x] **Font als Engine-Font** (15.11.2026): **BMFont** in + [`art/final/Font/`](../art/final/Font/) — Atlas und `.fnt`, 1× und 2×, + 93 Zeichen inkl. Umlauten und ß. Erzeugt und geprüft von + [`art/tools/font_export.py`](../art/tools/font_export.py) (setzt alle + Zeichen aus der `.fnt` und vergleicht mit `font8.draw_text`). Offen + bleibt nur, **wie** die Engine umbricht — das ist Engine-Arbeit. - [ ] **Interaktionszustände** vollständig: Buttons haben idle/hover/ gedrückt/deaktiviert; offen sind Scrollbalken, Listen-Hover, Tooltip-Verhalten und Mauszeiger-Varianten. @@ -245,9 +262,10 @@ Inhalte (Zaubersprüche, Gegenstände), keine Regeln. Eine **Entscheidung zur Basisauflösung** (0.0), ein `docs/systeme.md` (Regeln + Werte + Datenmodell — steht), ein `docs/ui.md` (Layout + Font + Zustände — steht, inkl. 8×10-Neusatz), das Referenzblatt aus 0.1 — und -danach ist der Stil **nicht mehr Thema**, sondern Vorgabe. Der 2×-Nachlauf -der Assets ist gelaufen; offen sind noch das Referenzblatt, die 9-Slice-Ränder -und der Engine-Export der Schrift. +danach ist der Stil **nicht mehr Thema**, sondern Vorgabe. **Alles davon steht +(Stand 15.11.2026):** Nachlauf, Referenzblatt, 9-Slice und Engine-Font sind +abgeliefert. Phase 0 ist damit zu — was in 0.1/0.2 noch offen steht (Weltpalette, +Kontrastregel, Listen-Zustände, NSC-Porträts), blockiert Phase 1 nicht. --- diff --git a/docs/ui.md b/docs/ui.md index b84bbcf..e5748c1 100644 --- a/docs/ui.md +++ b/docs/ui.md @@ -99,6 +99,23 @@ Kampfsprites stehen auf **48 px** (96er-Canvas halbiert), Gegner-TP als 18×2 Ein 47-Zeichen-Satz bei 390 px ist die Richtschnur für Dialogtext. Längerer Text braucht die 6-Zeilen-Box (390×107) oder einen Umbruch. +**Engine-Font (15.11.2026).** Der Satz wird aus +[`../art/tools/font_export.py`](../art/tools/font_export.py) als **BMFont** +exportiert — Quelle bleibt `font8.py`, die Dateien in +[`../art/final/Font/`](../art/final/Font/): + +| Datei | Inhalt | +|---|---| +| `font8_10_atlas.png` | 128×60, weiße Glyphen auf transparent (1×) | +| `font8_10.fnt` | BMFont-Textformat, Vorschub 8, Zeile 12, Basislinie 8 | +| `font8_10_atlas_2x.png` / `font8_10_2x.fnt` | dasselbe in 2× (Vorschub 16, Zeile 24) | + +Glyphen werden über `modulate` gefärbt (Textur ist weiß). In Godot: als +`FontFile` importieren, Filterung **nearest**, `antialiasing` aus, +`subpixel_positioning` aus, Hinting aus — sonst verwischen die 1-px-Striche. +Die Prüfung läuft ohne Godot: `font_export.py --check` setzt alle 93 Zeichen +aus der `.fnt` und vergleicht sie mit `font8.draw_text`. + ## 3. Bausteine | Element | Maß (1×) | Inhalt | @@ -113,6 +130,21 @@ Text braucht die 6-Zeilen-Box (390×107) oder einen Umbruch. | `ui_kampf_leiste_400x56` | 400×56 | Initiative-Chips + sechs Aktionen | | `ui_misc_220x130` | 220×130 | HP/SP/MP-Balken, Checkbox, Slider, Tooltip, Cursor | | `ui_ladebalken_240x26` | 240×26 | Ladebalken mit Segmenten und Prozent | +| `ui_panel_9slice_12px` | 12×12 | 9-Slice-Vorlage für beliebig große Panels | + +### 9-Slice-Panel (15.11.2026) + +`ui_panel_9slice_12px.png` ist ein Panel, das jede Engine-Seite dehnen kann: +außen 1 px `LINE`, innen 1 px Bevel (`PANEL_HI` oben/links, `PANEL_LO` +unten/rechts), Kern `PANEL`. Rand **2 px** bei 1× (4 px in der 2×-Datei). + +- In Godot: `NinePatchRect`, `patch_margin_*` = 2 (1×) bzw. 4 (2×). +- Mindestgröße 4×4; ab da ist das Ergebnis **pixelgleich** zu `panel()` in + `ui.py` — geprüft für 4×4 bis 400×56 mit + [`../art/tools/ui_slice.py`](../art/tools/ui_slice.py) (Beleg: + [`../art/prep/ui-slice/`](../art/prep/ui-slice/)). +- Wer die Bevel-Linien lieber selbst zeichnet (wie die Mocks), braucht die + Textur nicht: die Regel steht in §6. ## 4. Zustände @@ -125,8 +157,8 @@ Text braucht die 6-Zeilen-Box (390×107) oder einen Umbruch. | aktiv/ausgewählt | 2-px-`GOLD`-Rahmen (Party, Slots, Zauber), Chips mit `GOLD` | **Noch nicht gebaut:** Scrollbalken, Mauszeiger-Varianten, Hover für Listen, -Tooltip mit variabler Breite, 9-Slice-Panels. Panels sind derzeit feste -Größen. +Tooltip mit variabler Breite. Panels sind dagegen seit 15.11. variabel — als +9-Slice-Vorlage (§3). ## 5. Farben @@ -158,8 +190,10 @@ Die 16 UI-Farben stehen in `ui.py`; Anker ist ## 7. Offen -- **9-Slice** für variable Panels (Handelsfenster, Log, Kartenrand). -- **Engine-Font:** 8×10 als `FontFile`/BMFont/Textur-Atlas. +- ~~**9-Slice** für variable Panels~~ → **erledigt 15.11.2026** (§3). +- ~~**Engine-Font** als `FontFile`/BMFont~~ → **erledigt 15.11.2026**, BMFont + in [`../art/final/Font/`](../art/final/Font/) (§2). Offen bleibt nur, wie + die Engine Zeilen umbricht. - **Interaktionszustände** für Listen und Scrollbalken. - **Textumbruch-Regeln:** Trennstriche, Umlaute am Zeilenende, `%`-Abstände. - **Dialogbox 390** ist die Richtschnur; ob 6 Zeilen oder zwei Boxen besser