Skip to content
ASArcaneMP Scripting APIScripting reference
Data shapeClient APIGenerated

AvatarPreviewOptions

Defined in: client/api.d.ts:7116

What an AvatarPreview shows and where. Every field but anchor is optional; update() merges a partial object.

anchor: { rect: { h: number; visible?: boolean; w: number; x: number; y: number; }; view: number; } | { screen: { h: number; w: number; x: number; y: number; }; }

Defined in: client/api.d.ts:7125

The rect to frame into, in CSS pixels: relative to a Web view (what the page’s getBoundingClientRect() reports; amp-hole.js sends it) or to the screen. visible: false hides the figure and keeps it ready.


optional backdrop?: "none" | { color?: string | number[]; gradient?: string | number[] | null; match?: boolean; }

Defined in: client/api.d.ts:7140

An unlit slab behind the figure sized to the rect. ‘#rrggbb’ (sRGB) or [r, g, b] (linear); gradient blends top to bottom. Without match the color is the slab’s emissive, so the view’s exposure, tone curve and grading move it. match: true makes the colors what the slab’s pixels must be: it measures the screen and corrects the slab until a CSS color beside it matches, at any rect size, place or hour (SDR only; state().match reports progress). Default { color: ‘#16181e’, match: false }.


optional backend?: "auto" | "world" | "texture"

Defined in: client/api.d.ts:7145

“world” is the camera-locked slab and the only one built; “texture” falls back to it and says so in status.


optional camera?: object

Defined in: client/api.d.ts:7130

framing: how much of the figure fills the rect’s height (default full). yaw: degrees added to facing you (default -15). fov and pitch are texture-backend settings the world backend ignores.

optional fov?: number

optional framing?: "full" | "head" | "body"

optional pitch?: number

optional yaw?: number


optional light?: object

Defined in: client/api.d.ts:7135

The private studio rig; “none” or scale 0 hands the figure back to world light. “fieldguide” is not built yet and uses “studio”.

optional rig?: "none" | "studio" | "fieldguide"

optional scale?: number


optional quality?: object

Defined in: client/api.d.ts:7150

Texture backend only; ignored.

optional fps?: number

optional scale?: number


optional subject?: "self"

Defined in: client/api.d.ts:7120

Whose figure. Only your own look for now.


optional world?: object

Defined in: client/api.d.ts:7155

World-backend knobs. scale: actor scale (default 0.6; smaller sits nearer the camera, so less of the world gets in front). depth: cm from the figure to the slab (40). margin: px the slab runs past the rect (8). isolate: drop fog and ambient light from the whole view and fix its exposure, honoured only while the rect covers 75% of the screen.

optional depth?: number

optional isolate?: boolean

optional margin?: number

optional scale?: number