diff --git a/site/public/brand/companion/broken.webp b/site/public/brand/companion/broken.webp new file mode 100644 index 00000000..5f540734 Binary files /dev/null and b/site/public/brand/companion/broken.webp differ diff --git a/site/public/brand/companion/debug.webp b/site/public/brand/companion/debug.webp new file mode 100644 index 00000000..fec154eb Binary files /dev/null and b/site/public/brand/companion/debug.webp differ diff --git a/site/public/brand/companion/hint.webp b/site/public/brand/companion/hint.webp new file mode 100644 index 00000000..3f56f680 Binary files /dev/null and b/site/public/brand/companion/hint.webp differ diff --git a/site/public/brand/companion/info.webp b/site/public/brand/companion/info.webp new file mode 100644 index 00000000..83ebb2b4 Binary files /dev/null and b/site/public/brand/companion/info.webp differ diff --git a/site/public/brand/companion/invalid.webp b/site/public/brand/companion/invalid.webp new file mode 100644 index 00000000..28937a9e Binary files /dev/null and b/site/public/brand/companion/invalid.webp differ diff --git a/site/public/brand/companion/pitfall.webp b/site/public/brand/companion/pitfall.webp new file mode 100644 index 00000000..1698d950 Binary files /dev/null and b/site/public/brand/companion/pitfall.webp differ diff --git a/site/public/brand/companion/success.webp b/site/public/brand/companion/success.webp new file mode 100644 index 00000000..56c2e8c1 Binary files /dev/null and b/site/public/brand/companion/success.webp differ diff --git a/site/public/brand/companion/warning.webp b/site/public/brand/companion/warning.webp new file mode 100644 index 00000000..730dae9d Binary files /dev/null and b/site/public/brand/companion/warning.webp differ diff --git a/site/src/components/Callout.astro b/site/src/components/Callout.astro index 5ae173fb..e009af5d 100644 --- a/site/src/components/Callout.astro +++ b/site/src/components/Callout.astro @@ -1,58 +1,85 @@ --- /** - * Callout — a labelled aside for notes, tips, warnings, and platform hints. + * Callout — a labelled aside for the eight Guide Companion states. + * + * Each state pairs the painterly companion sprite (a trailing-edge badge) with a + * state-coloured glyph + label. The glyph and label carry the meaning, so the + * callout reads for colour-blind readers and in high-contrast modes; the sprite + * and its state-coloured screen-glow are enrichment. * * Usage in MDX: * import Callout from '../../../components/Callout.astro'; * - * - * Start each frame with `context.backend.clear()`. + * + * Pulling in several assets? `loadMany()` batches the requests for you. * * - * + * * A sprite's default anchor is the top-left corner, not its center. * * - * The type is conveyed by a text label and a glyph, never colour alone, so the - * meaning survives for colour-blind readers and in high-contrast modes. + * Colour exclusivity: amber=warning, mint=success, gray=invalid, red=broken; + * info/hint/pitfall/debug share the companion cyan and are told apart by glyph. */ -type CalloutType = 'note' | 'tip' | 'important' | 'common-mistake' | 'webgpu' | 'browser'; +type CalloutType = 'info' | 'hint' | 'warning' | 'pitfall' | 'success' | 'debug' | 'invalid' | 'broken'; interface Props { type?: CalloutType; - /** Optional heading. Falls back to the type's default label. */ + /** Optional heading. Falls back to the state's default label. */ title?: string; } const META: Record = { - 'note': { label: 'Note', glyph: 'i' }, - 'tip': { label: 'Tip', glyph: '+' }, - 'important': { label: 'Important', glyph: '!' }, - 'common-mistake': { label: 'Common mistake', glyph: '×' }, - 'webgpu': { label: 'WebGPU', glyph: '◆' }, - 'browser': { label: 'Browser behavior', glyph: '◐' }, + info: { label: 'Good to know', glyph: 'i' }, + hint: { label: 'Tip', glyph: '✦' }, + warning: { label: 'Heads up', glyph: '!' }, + pitfall: { label: 'Common pitfall', glyph: '?' }, + success: { label: "You're set", glyph: '✓' }, + debug: { label: 'Debug tip', glyph: '[]' }, + invalid: { label: 'Not supported', glyph: 'Ø' }, + broken: { label: 'Runtime error', glyph: '✕' }, }; -const { type = 'note', title } = Astro.props; +const { type = 'info', title } = Astro.props; const meta = META[type]; const heading = title ?? meta.label; +const base = import.meta.env.BASE_URL; --- diff --git a/site/src/content/guide/audio/audio-basics.mdx b/site/src/content/guide/audio/audio-basics.mdx index d07bd85a..1ea87828 100644 --- a/site/src/content/guide/audio/audio-basics.mdx +++ b/site/src/content/guide/audio/audio-basics.mdx @@ -60,7 +60,7 @@ if (this.app.audio.locked) { } ``` - + Browsers won't start audio until the user interacts with the page. Trigger the first sound or music from a click, tap, or key press — the embedded examples below ask for a click for exactly this reason. diff --git a/site/src/content/guide/getting-started/setup.mdx b/site/src/content/guide/getting-started/setup.mdx index 7cee9e7a..d7410927 100644 --- a/site/src/content/guide/getting-started/setup.mdx +++ b/site/src/content/guide/getting-started/setup.mdx @@ -75,7 +75,7 @@ const app = new Application({ canvas: { element: canvas } }); // ...or let the application create one and mount app.canvas yourself. ``` - + `app.canvas` is the active `HTMLCanvasElement` the runtime renders into. Append it wherever your layout needs it. diff --git a/site/src/content/guide/getting-started/what-is-exojs.mdx b/site/src/content/guide/getting-started/what-is-exojs.mdx index a0758281..46a75796 100644 --- a/site/src/content/guide/getting-started/what-is-exojs.mdx +++ b/site/src/content/guide/getting-started/what-is-exojs.mdx @@ -47,7 +47,7 @@ ExoJS ships as ESM with TypeScript declarations. JavaScript projects can use the ExoJS targets evergreen browsers: current Chrome, Firefox, Edge, and Safari. Some examples in this guide need browser features beyond rendering — audio playback, gamepad APIs, or multi-touch input. Capability badges above each example list what it expects; when a feature is missing, the embedded preview shows a clear overlay instead of failing silently. - + On startup the runtime auto-selects the strongest available backend — WebGPU when present, WebGL2 otherwise. You write the same scene code either way. diff --git a/site/src/content/guide/getting-started/your-first-scene.mdx b/site/src/content/guide/getting-started/your-first-scene.mdx index 702f2262..17becef6 100644 --- a/site/src/content/guide/getting-started/your-first-scene.mdx +++ b/site/src/content/guide/getting-started/your-first-scene.mdx @@ -59,7 +59,7 @@ A few things worth pointing out: - `loader.load(Texture, { bunny: 'image/bunny.png' })` declares one asset under the name `bunny`. Inside `init`, `loader.get(Texture, 'bunny')` returns the loaded texture instance. Names are stable; paths can change later without touching the rest of the code. - The default sprite anchor is `(0, 0)` — the top-left. With `setAnchor(0.5)`, the sprite's center becomes its pivot point, so `setPosition(width / 2, height / 2)` places the sprite at the canvas center rather than offset to one corner. - + A sprite's default anchor is its top-left corner. `setPosition(width / 2, height / 2)` then places the corner — not the center — at the middle of the canvas. Call `setAnchor(0.5)` first.