rimworld-blax-zones/Source/Art/README.md

57 lines
5.6 KiB
Markdown
Raw Permalink Normal View History

# Preview art
`preview.html` renders `About/Preview.png` (1280x720) and `icon.html` renders `About/ModIcon.png` (256x256) from `icon.svg`. Both follow the Blax CI from https://www.blax.at/ui-ci and match Blax Slaves' and Blax Castes' art, so the mods read as one label: Blax black `#050805`, Blax green `#19C63C`, logo gray `#CDCDCD`, Geist for headings, Inter for body text, Rajdhani only for the "Blax Gaming" wordmark. Fonts are the woff2 files blax.at self-hosts (all SIL Open Font License); icons are lucide (ISC license).
The preview has Slaves' layout: wordmark top left, "Blax Zones" with a green subtitle on the left, four feature rows on the right (delivery zones, filter and priority, reachable overflow, caravan camps). The icon is the Blax monogram with a green "package" badge, so it stands apart from Slaves' plain monogram and Castes' "layers" badge in the mod list.
| File | Renders |
|---|---|
| `preview.html` | `About/Preview.png`, 1280x720 |
| `icon.html` + `icon.svg` | `About/ModIcon.png`, 256x256, transparent |
| `header.html` | the Workshop section headers in `docs/art/steam/`, 1270x150 |
| `oss-banner.html` | `docs/art/blax-oss-banner.png`, 1600x254, from `docs/art/blax-oss-banner.svg` |
| `blax-monogram.svg`, `monogram-centered.svg` | the Blax monogram, used by the pages above |
| `fonts/` | Geist, Inter, Rajdhani 700 |
Render with Edge headless from this folder. The separate profile folder keeps the headless run away from an open Edge window, and `| Out-Null` waits for each screenshot.
```powershell
$edge = 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe'
$here = (Get-Location).Path -replace '\\','/'
$edgeData = "$env:TEMP\blax-art-edge-zones"
& $edge --headless=new --disable-gpu --hide-scrollbars --user-data-dir="$edgeData" --virtual-time-budget=3000 --window-size=1280,720 --screenshot="$PWD\..\..\About\Preview.png" "file:///$here/preview.html" | Out-Null
& $edge --headless=new --disable-gpu --hide-scrollbars --user-data-dir="$edgeData" --virtual-time-budget=2000 --window-size=256,256 --default-background-color=00000000 --screenshot="$PWD\..\..\About\ModIcon.png" "file:///$here/icon.html" | Out-Null
```
`About/Preview.png` must stay under 1 MB for the Workshop; it is about 85 KB.
## Workshop page art
The Steam description (`docs/workshop-description.txt`) shows a section header from `docs/art/steam/` above each part and Blax Software's Open Source Initiative banner at the end. Steam shows no SVG, so the banner (`docs/art/blax-oss-banner.svg`, the same file as in Blax Slaves) is also rendered as a PNG; it is the same PNG as Slaves' `docs/art/blax-oss-banner.png`. `header.html` takes the title (`t`), subtitle (`s`) and lucide icon name (`i`) as query parameters; the icon must be in its `icons` map.
| File | t | s | i |
|---|---|---|---|
| `deliveries.png` | Delivery zones | Orbital purchases land where you want them | package |
| `camps.png` | Caravan camps | Traders gather next to a zone you pick | tent |
| `planned.png` | Planned | Coming in later releases | milestone |
| `replaces.png` | Replaces | Mods you can unsubscribe | replace |
| `compatibility.png` | Compatibility | Plays well with these | puzzle |
```powershell
& $edge --headless=new --disable-gpu --hide-scrollbars --user-data-dir="$edgeData" --virtual-time-budget=3000 --window-size=1600,254 --screenshot="$PWD\..\..\docs\art\blax-oss-banner.png" "file:///$here/oss-banner.html" | Out-Null
& $edge --headless=new --disable-gpu --hide-scrollbars --user-data-dir="$edgeData" --virtual-time-budget=3000 --window-size=1270,150 --screenshot="$PWD\..\..\docs\art\steam\deliveries.png" "file:///$here/header.html?t=Delivery%20zones&s=Orbital%20purchases%20land%20where%20you%20want%20them&i=package" | Out-Null
& $edge --headless=new --disable-gpu --hide-scrollbars --user-data-dir="$edgeData" --virtual-time-budget=3000 --window-size=1270,150 --screenshot="$PWD\..\..\docs\art\steam\camps.png" "file:///$here/header.html?t=Caravan%20camps&s=Traders%20gather%20next%20to%20a%20zone%20you%20pick&i=tent" | Out-Null
& $edge --headless=new --disable-gpu --hide-scrollbars --user-data-dir="$edgeData" --virtual-time-budget=3000 --window-size=1270,150 --screenshot="$PWD\..\..\docs\art\steam\planned.png" "file:///$here/header.html?t=Planned&s=Coming%20in%20later%20releases&i=milestone" | Out-Null
& $edge --headless=new --disable-gpu --hide-scrollbars --user-data-dir="$edgeData" --virtual-time-budget=3000 --window-size=1270,150 --screenshot="$PWD\..\..\docs\art\steam\replaces.png" "file:///$here/header.html?t=Replaces&s=Mods%20you%20can%20unsubscribe&i=replace" | Out-Null
& $edge --headless=new --disable-gpu --hide-scrollbars --user-data-dir="$edgeData" --virtual-time-budget=3000 --window-size=1270,150 --screenshot="$PWD\..\..\docs\art\steam\compatibility.png" "file:///$here/header.html?t=Compatibility&s=Plays%20well%20with%20these&i=puzzle" | Out-Null
```
Check each result for its size before using it:
```powershell
Add-Type -AssemblyName System.Drawing
Get-ChildItem ..\..\About\*.png, ..\..\docs\art\steam\*.png, ..\..\docs\art\*.png | ForEach-Object { $i = [System.Drawing.Image]::FromFile($_.FullName); '{0}: {1}x{2}, {3} bytes' -f $_.Name, $i.Width, $i.Height, $_.Length; $i.Dispose() }
```
The Steam page loads these images from the Blax CDN (`https://cdn.blax.at/blax-gaming/`), not from Forgejo: Steam requests description images cross-origin, and only the CDN answers with `Access-Control-Allow-Origin`. After re-rendering, copy the PNGs to `blax-gaming/zones/` on the CDN (`blax-gaming/zones/<name>.png`; the banner is shared at `blax-gaming/blax-oss-banner.png` and is already there). The upload steps are in Blax's internal infrastructure docs.