docs(arch): update CardImageSet and asset pipeline for 52-face PNG system
Replace the stale single-face placeholder description with the live 52-PNG system: CardImageSet.faces is now [[Handle<Image>; 13]; 4] indexed by [suit][rank], face images are generated by solitaire_assetgen using ab_glyph with rank/suit baked in, and Text2d overlays are fallback-only. Remove the now-completed "Future art pass / texture atlas upgrade" note from Section 14. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+4
-11
@@ -69,7 +69,7 @@ solitaire_quest/
|
||||
│
|
||||
├── assets/ # Assets embedded at compile time via include_bytes!()
|
||||
│ ├── cards/
|
||||
│ │ ├── faces/face.png # placeholder (16×16 cream/ivory)
|
||||
│ │ ├── faces/{rank}_{suit}.png # 52 individual card faces (120×168, generated by solitaire_assetgen)
|
||||
│ │ └── backs/back_0.png – back_4.png # placeholder patterns
|
||||
│ ├── backgrounds/bg_0.png – bg_4.png # placeholder textures
|
||||
│ ├── fonts/main.ttf # FiraMono-Medium (170K, OFL)
|
||||
@@ -292,7 +292,7 @@ struct SettingsResource(Settings);
|
||||
|
||||
// Pre-loaded card face and back PNG handles
|
||||
struct CardImageSet {
|
||||
face: Handle<Image>, // shared face image for all face-up cards
|
||||
faces: [[Handle<Image>; 13]; 4], // [suit][rank]: Clubs=0..Spades=3, Ace=0..King=12
|
||||
backs: [Handle<Image>; 5], // indexed by selected_card_back setting
|
||||
}
|
||||
|
||||
@@ -772,7 +772,7 @@ Audio systems listen for Bevy events and never block the game thread.
|
||||
|
||||
### Rendering approach
|
||||
|
||||
Cards are Bevy `Sprite` entities with `Handle<Image>` from `CardImageSet`. Face-up cards use `face.png` (a single shared image). Face-down cards use `backs/back_N.png` indexed by `settings.selected_card_back`. `Text2d` labels are still overlaid for rank and suit symbols. `CardImageSet` is populated at startup from `include_bytes!()` — no `AssetServer`.
|
||||
Cards are Bevy `Sprite` entities with `Handle<Image>` from `CardImageSet`. Face-up cards use one of 52 individual face PNGs selected by `faces[suit][rank]` — rank and suit are baked into each image and no `Text2d` overlay is spawned. Face-down cards use `backs/back_N.png` indexed by `settings.selected_card_back`. `Text2d` labels are only used as a fallback when `CardImageSet` is absent (e.g. tests with `MinimalPlugins`). `CardImageSet` is populated at startup from `include_bytes!()` — no `AssetServer`.
|
||||
|
||||
Backgrounds are Bevy `Sprite` entities with `Handle<Image>` from `BackgroundImageSet`. `BackgroundImageSet` is populated at startup from `include_bytes!()`.
|
||||
|
||||
@@ -783,7 +783,7 @@ The `assets/` directory layout:
|
||||
```
|
||||
assets/
|
||||
├── cards/
|
||||
│ ├── faces/face.png # placeholder (16×16 cream/ivory)
|
||||
│ ├── faces/{rank}_{suit}.png # 52 individual card faces (120×168, generated by solitaire_assetgen)
|
||||
│ └── backs/back_0.png – back_4.png # placeholder patterns
|
||||
├── backgrounds/bg_0.png – bg_4.png # placeholder textures
|
||||
├── fonts/main.ttf # FiraMono-Medium (170K, OFL)
|
||||
@@ -809,13 +809,6 @@ All sound effect WAV files are embedded at compile time via `include_bytes!()` i
|
||||
| `win_fanfare.wav` | Game won |
|
||||
| `ambient_loop.wav` | Looping background music |
|
||||
|
||||
### Future art pass
|
||||
|
||||
The placeholder PNG files can be replaced with real artwork without any code changes — just drop in new PNGs and rebuild. The texture atlas approach described below is still the recommended upgrade path for card faces:
|
||||
- Use a texture atlas (`assets/cards/atlas.png` + layout descriptor) for card faces
|
||||
- Individual PNGs for card backs and backgrounds (5 each)
|
||||
- All assets remain embedded via `include_bytes!()` to keep the binary self-contained
|
||||
|
||||
---
|
||||
|
||||
## 15. Platform Targets
|
||||
|
||||
Reference in New Issue
Block a user