The game's look

Colours, text, frames, buttons, named parts and UI sounds: how every screen looks, all in src/content/look/.

Everything about how the UI looks, sounds and behaves lives in one folder, src/content/look/. It styles every MUI part through the theme, so window code never needs to change, and you never edit src/core/ for it. Build your UI from MUI parts (Box, Typography, Button, Paper...) and they all follow it.

FileWhat you edit there
colors.tsThe palette: text, accent, good / warn / danger...
text.tsFont and text sizes, per Typography variant
frames.tsThe frame pictures the other files share
buttons.tsEvery Button, by colour and by variant
parts.tsNamed looks: engine parts (choices, touch buttons...) and your own
sounds.tsUI sounds: move, click, tab, window open / close
mui.tsDefault props (behaviour) and raw MUI theme options, merged last
map.tsText and speech bubbles on the map: name labels, the "press A" prompt, bark() bubbles (font, size, colours, outline, padding, fade)
glyphs.tsHow keys and controller buttons are named in prompts and on the controls screen, per controller kind, with colours for face buttons
index.tsPanels, tabs, dropdowns, bars, sliders, switches, scrollbars, window gap

To see every part in every state at once, open the dev panel (` key) → Look → Open look gallery. It updates as you save.

Colours

colors.ts becomes the MUI palette. Changing one line recolours every part that uses it, plus every color="primary" or sx={{ color: 'text.secondary' }} in your windows.

// src/content/look/colors.ts
export const gold = '#f2d48a'   // your own names, to import in the other look files

export default {
  text: '#f0e6d2',        // 'text.primary'
  muted: '#b9ae9a',       // 'text.secondary': hints, captions
  disabled: '#7d766a',    // 'text.disabled'
  accent: gold,           // 'primary': primary buttons, switches that are on, sliders, spinners
  second: '#90caf9',      // 'secondary'
  good: '#81c784', warn: '#ffb74d', danger: '#ef5350', info: '#64b5f6',
  divider: 'rgba(240, 230, 210, 0.16)',
  background: '#0d1117',  // 'background.default'
  surface: '#1b2433',     // 'background.paper': panels without a frame
} satisfies LookColors

Fonts

Put a font file (woff2, woff, ttf or otf) in src/content/fonts/ and name it in index.ts there. It ships with the game, so no internet is needed (check the font's licence allows that).

// src/content/fonts/index.ts
import pixel from './pixel.woff2'
import emoji from './NotoColorEmoji.ttf'

export default defineFonts({
  pixel: { name: 'Pixel', file: pixel },                    // a choice in Settings → Text → Font
  emoji: { name: 'Emoji', file: emoji, use: 'fallback' },   // fills in letters the others lack
  special: { name: 'Special', file: special, use: 'internal' }, // only where you name it
})

The font in use, for things that should change with it:

import { useFont } from '@/core/managers/fonts'
const icon = useFont() === 'pixel' ? pixelIcon : icon     // React: updates when the player picks another

game.fonts.current()   // the same outside React: 'game', 'sans', 'pixel'…
game.fonts.choices()   // every choice: { id, name, family }
game.fonts.playerPicks()   // false when scenes.ts hides the Font row

In your own windows use the palette names, not colour codes, so they follow the look: sx={{ color: 'warning.main', borderColor: 'divider' }}. A minigame that needs its own colours keeps them in its own file or inline.

Text

// src/content/look/text.ts
export default {
  font: "'MyFont', sans-serif",
  size: 15,                                  // base size in px (default 14)
  h6: { fontWeight: 700 },                   // window and section titles
  body2: { fontSize: 14 },                   // most text in windows
  caption: { opacity: 0.8 },
  button: { textTransform: 'none' },         // the text on every Button
} satisfies LookText

The names are the MUI Typography variants (<Typography variant="body2">). Each takes plain CSS.

Boxes and frames

Each part is a box: a background (any CSS background), a text color and, for art, a 9-slice frame image. The frame's corners keep their size, its sides stretch or tile, and its middle fills the inside, so one picture fits a button or a full window.

// src/content/look/index.ts
export default defineLook({
  colors, text, button, parts, sounds, mui,
  panel: { image: panelImage, slice: 8, scale: 2, pixelated: true },   // every Paper
  tabs: { tab: { selected: { image: buttonFocus, slice: 4 } }, indicator: 'none' },
})
Frame optionMeaning
slicePixels of the image that are frame: one number, or [top, right, bottom, left]. Default 16.
scaleEdge size on screen = slice × scale px. Pixel art cut at 4px with scale: 3 draws 12px edges; high-res art cut at 96px with scale: 0.25 draws 24px edges. Default 1.
sides'stretch' (default), 'round' (tile whole copies: use it for patterned edges), 'repeat', 'space'.
pixelatedSharp pixels when scaled (pixel art). Leave it off for high-res art, which then scales smoothly.

panel is the base of every MUI Paper (windows, chat box, toasts, battle panels, dropdown lists); window and dialog override it for windows and the chat box only. The look sets styles only: to add something to a window or the chat box (a logo, a footer) or move their parts, use src/content/ui/Window.tsx and src/content/ui/TextDialog.tsx.

Every box also takes css: plain CSS properties, applied last, so they win over everything else the box sets (a frame squares the corners; css can round them again). A state's css is added to the normal one.

Parts that react also take focus, pressed, disabled and selected boxes, merged over the normal one. A state without its own frame image keeps the frame with a small effect, so it always shows: focus brighter, pressed darker, disabled grey. A selected part that is focused keeps its selected picture. Parts with their own focus look drop MUI's pulsing grey focus blob (the click ripple stays). Focus is what gamepad and keyboard players see, so give it a clear picture; it also shows on mouse hover.

Buttons

A button has a colour (color="error") and a variant (variant="contained", "outlined" or "text"). Its look is built in this order, each on top of the one before: all → all.<variant> → <colour> → <colour>.<variant>. What you write straight in a look goes to all three variants.

// src/content/look/buttons.ts
const plain: LookButton = { image: button, slice: 4, color: '#f0e6d2' }

export default {
  all: {
    focus: { image: buttonFocus, slice: 4, color: 'gold' },
    pressed: { css: { transform: 'translateY(1px)' } },
  },
  primary: plain,                                   // one style for all three variants
  secondary: {
    ...plain,                                       // shared by the three...
    contained: { color: 'white' },                  // ...then each variant can differ
    text: { image: undefined, background: 'transparent' },
  },
  error: { image: buttonError, slice: 4 },
} satisfies LookButtons

Named parts

parts.ts holds looks with a name. The engine draws some itself (keep those names, change the looks); add your own next to them and the name works, and autocompletes, everywhere.

// src/content/look/parts.ts
export default {
  choice: { image: button, slice: 4 },                       // engine: event answer buttons
  cover: { background: 'rgba(0, 0, 0, 0.5)' },                // engine: behind a modal window
  // ...
  fancy: { image: gold, slice: 4, focus: { color: 'white' } }, // yours
} satisfies LookParts
<Button variant="fancy">Buy</Button>      // a Button: starts from buttons.ts `all`, no MUI variant styling
<Paper variant="fancy">...</Paper>
<Box sx={part('fancy')} />                // anything else (import { part } from '@/core/ui/part')
<Box sx={part('fancy', 'selected')} />    // one state drawn flat, when you pick the state yourself
Engine partWhere
choiceEvent answer buttons
titleButtonTitle screen menu buttons
cover, logCoverThe dark layer behind a modal window / behind the event log
sceneToolbarThe strip of the scene toolbar's buttons (Settings, Save, Back, Auto, Skip… all of them), wherever toolbar.place puts it
sideImageThe frame around the speaker's face next to the text (side image): no background or border = only the face
insetThe frame of the picture in the middle (inset()). Optional: without it the picture only gets a shadow
nameTagThe speaker's name on the chat box (a character's color replaces its background; a character's chatBox can lay its own looks over the box, the name and the text: A chat box per character)
chapterCard, chapterCardLabel, chapterCardTitleThe full-screen chapter card: its cover, the "Chapter 1" line, and the title (Chapters)
lineText, narrationTextThe chat box's text: a line someone says, and narration. Use solid colours (no rgba): the player's "Text box opacity" fades the box behind the text, and see-through text would let the scene show through the letters
lineTextRead, narrationTextRead (optional)Added on top of the two above for a line the player has read before (in any playthrough, the same lines Skip passes): another colour, a softer weight. Leave them out and read lines look like new ones. A custom TextDialog.tsx also gets read.
touchButton, joystick, joystickKnobOn-screen touch controls and the ☰ menu button
viewer, viewerDotClose button, caption and variant dots over a full-screen picture

UI sounds

sounds.ts names a sound from src/content/audio/ for each thing the UI does. The engine plays them by itself for every control, on all devices; leave a line out for silence. They use the SFX volume.

// src/content/look/sounds.ts
export default {
  move: { id: 'sfx/blip', volume: 0.4 },   // focus moved (keyboard / gamepad)
  hover: 'sfx/blip',                       // mouse moved onto a control
  click: 'sfx/click',                      // button, menu row, dropdown
  tab: 'sfx/click',                        // a tab was picked
  toggle: 'sfx/click',                     // switch or checkbox
  open: 'sfx/confirm',                     // a window opened
  close: 'sfx/click',                      // a window closed
  buy: 'sfx/confirm',                      // your own name
} satisfies LookSounds

One element can differ with the data-sound attribute. It works on any element, and on a parent it covers everything inside (a whole list, a whole window body).

<Button data-sound="buy">Buy</Button>     // plays `buy` from sounds.ts instead of `click`
<Button data-sound="none">...</Button>    // silent
<Stack data-sound="none">...</Stack>      // every control inside is silent
ValueEffect
not setThe default for what the control is: click, tab (a tab) or toggle (switch, checkbox, radio); move / hover when it is reached
"none"No UI sound at all for it: no click, move or hover
"name"Plays that line of sounds.ts when clicked. A name that is not in sounds.ts is silent.

Use data-sound="none" whenever a button's onClick plays its own sound, or the player hears two at once. The shop's Buy / Sell and the Save button do this: they play a confirm sound only when the action worked.

<Button
  data-sound="none"
  onClick={() => {
    if (game.shops.buy(shop, id) === 'ok') game.audio.sfx('sfx/confirm')
  }}
>
  Buy
</Button>

Behaviour and everything else

mui.ts is a raw MUI theme, merged last. Use defaultProps for how a part behaves everywhere, and styleOverrides for anything the look has no setting for.

// src/content/look/mui.ts
export default {
  components: {
    MuiButton: { defaultProps: { variant: 'outlined', size: 'large' } },
    MuiButtonBase: { defaultProps: { disableRipple: true } },      // no click ripple anywhere
    MuiTooltip: { styleOverrides: { tooltip: { fontSize: 14 } } },
  },
} satisfies ThemeOptions

Pixel art or high-res

Both work; only the numbers change. slice is always in the image's own pixels, and the frame's thickness on screen is slice × scale CSS px.

Parts in index.ts

PartStyles
panelEvery MUI Paper: windows, the chat box, toasts, battle panels, dropdown lists, alerts
window, dialogWindows / the event chat box only (over panel)
iconButtonRound icon buttons, e.g. a window's ✕
tabsbar (strip), tab (selected = open tab), indicator (CSS background or 'none')
sliderheight, rail, track (filled part; { background: 'transparent', css: { border: 'none' } } hides it), thumb + thumbSize
progressheight, rail, bar (HP/XP bars, loading)
switchtrack, thumb, and on: { track, thumb } for the switched-on look
input, menu, menuItemA closed dropdown, the list it opens, one row of it
chip, alert, avatarChips (the money counter, quest tags; states show on clickable ones), alert boxes, avatars

scrollbar colours the browser's own scrollbars everywhere (width: 'auto', 'thin' or 'none'). Leave it out and they are still dark, never the white default.

windowGap is the empty space (px) kept around windows so the game shows at their edges. It follows the game screen's shorter side: min on screens up to smallScreen px, max from largeScreen px, in between it grows smoothly. Phones get min (32 by default, half of max); set it to 0 to let them use every pixel.