Skip to content

Documentation / @debuffjp/core / GameOptions

Interface: GameOptions ​

Defined in: core/src/game.ts:34

Properties ​

background? ​

optional background?: string

Defined in: core/src/game.ts:61

Opaque background colour, cleared every frame. Default "#000".


blendSpace? ​

optional blendSpace?: "srgb" | "linear"

Defined in: core/src/game.ts:57

Where colours mix when drawn over each other: spryte's blendSpace. "srgb" (default) mixes sRGB bytes as CSS does; "linear" mixes in linear light, so anti-aliased edges keep their weight and glows add up like light, for one extra full-screen pass. WebGL2 only. Mark data images with asData under "linear". Since 0.34.


canvas ​

canvas: HTMLCanvasElement

Defined in: core/src/game.ts:35


clock? ​

optional clock?: FixedClockOptions

Defined in: core/src/game.ts:59


container? ​

optional container?: HTMLElement

Defined in: core/src/game.ts:44

Element whose size drives scaling. Default: the canvas's parent.


height ​

height: number

Defined in: core/src/game.ts:38


pixelArt? ​

optional pixelArt?: boolean

Defined in: core/src/game.ts:46

Nearest-neighbour sampling for crisp pixel art. Default false.


pixelSize? ​

optional pixelSize?: number

Defined in: core/src/game.ts:42

CSS pixels per logical unit in scale: "pixel". Default 3.


reducedMotion? ​

optional reducedMotion?: boolean | "auto"

Defined in: core/src/game.ts:66

Honour the player's reduced-motion preference. "auto" (default) follows prefers-reduced-motion live; true/false force it.


renderer? ​

optional renderer?: "2d" | "webgl2" | "auto"

Defined in: core/src/game.ts:51

Rendering backend. auto (default) uses WebGL2 and falls back to Canvas 2D when it is unavailable. Both implement the same draw API (ADR 0007).


scale? ​

optional scale?: ScaleMode

Defined in: core/src/game.ts:40

Default "fit".


seed? ​

optional seed?: number

Defined in: core/src/game.ts:58


splash? ​

optional splash?: boolean | SplashOptions

Defined in: core/src/game.ts:75

A short "made with debuff" card when the game first starts, before your first frame. Any key, click or tap skips it. Not shown in dev, or when time is driven by step() (scenarios, agents). false removes it. Default on.

Publishing on Poki? Turn it off: Poki doesn't allow splash screens. Other portals have similar rules; see https://debuff.jp/docs/publishing.


width ​

width: number

Defined in: core/src/game.ts:37

Logical resolution. Game code always works in these units. With scale: "expand" or "pixel" it's the minimum size.