M4: художественный конвейер

- scripts/build-art.mjs: все спрайты игры собираются из исходников,
  а не кладутся руками. Лица карт растеризуются из векторов,
  рубашка/стол/панели/кнопки нарисованы SVG-ом прямо в скрипте
- 36 лиц 220x320 + рубашка, автоатлас 2048x2048, обрезка выключена
  (раскладка рассчитывает на точный размер карты)
- девятипатчевые плитки 120x120 с рамкой 40
- фон стола 540x960, рисуется в 2x — градиенту детализация не нужна,
  а памяти под текстуру уходит вчетверо меньше
- исходные векторы перенесены из local/ в art-src/cards
- ATTRIBUTION.md: LGPL-3.0, атрибуция обязательна; там же написано,
  что менять, если такая лицензия не подходит для релиза

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
ftc
2026-09-13 10:52:37 +03:00
co-authored by Claude Opus 5
parent 51117a698c
commit 2056673946
134 changed files with 17075 additions and 8 deletions
+33 -2
View File
@@ -41,8 +41,8 @@ assets/
card.prefab one playing card, face or back
...
art/
cards/ 36 faces + back, atlased
ui/ panels, buttons, table surface
cards/ 36 faces + back, packed into cards.pac (2048²)
ui/ table surface, nine-slice panels and buttons
scripts/
core/ PURE TS — no engine imports
cards/ Suit, Rank, Card, Deck
@@ -62,8 +62,10 @@ tests/
core/ vitest specs against assets/scripts/core
support/ position fixtures and the state invariant checker
tools/ measuring tools, not part of the suite
art-src/cards/ vector sources for the card faces (LGPL, kept)
docs/ specs, this file, plan, decisions
local/ scratch art storage; contents get consumed
scripts/ build and check tools run through npm
extensions/cocos-code-mode/ editor tool server
```
@@ -155,6 +157,35 @@ Scripts and other text assets are written to disk directly and picked up by the
editor's asset watcher. Scenes and prefabs are authored through the tools —
never by hand-editing the `.scene`/`.prefab` JSON.
### Art
```bash
npm run build:art
```
Regenerates every sprite in `assets/art` from source. Card faces are rasterised
from the vectors in `art-src/cards`; the card back, table and UI chrome are
authored as SVG inside [`scripts/build-art.mjs`](../scripts/build-art.mjs) and
rasterised from there, so a colour or radius is changed in one readable place
rather than in a binary.
Fixed numbers the layout depends on:
| | |
|---|---|
| Card sprite | 220 × 320 px |
| Nine-slice border | 40 px on 120 × 120 tiles |
| Table background | 540 × 960, drawn at 2× |
Card sprite frames have trimming switched off, because layout maths assumes
every card rect is exactly 220 × 320. Card faces are named `<rank>_of_<suit>`,
matching `Card.assetName` — that string is the only contract between the rules
core and the art.
Licence: the faces are LGPL-3.0 and attribution is mandatory. See
[`assets/art/cards/ATTRIBUTION.md`](../assets/art/cards/ATTRIBUTION.md), which
also explains what would have to change to drop the dependency.
### Builds
Web: `web-mobile` template. Mobile: ASTC textures per [ART.md](ART.md), PNG for