# ViewModelConfig

> Talos next · Since 0.6

## Signature

```ts
export interface ViewModelConfig {
  /** Frames by name. */
  frames: Record<string, ViewModelFrame>
  /** The frames drawn at the start. Default the first one. */
  show?: string[]
  /** The virtual canvas, in pixels. Default 320 × 200. */
  virtualSize?: Vec2
  /** Where every frame's pivot lands on the canvas, in virtual pixels. Default bottom-centre. */
  anchor?: Vec2
  /** Virtual pixels per source pixel. Default 1. */
  scale?: number
  /** Virtual pixels the bob swings sideways and dips at full walking speed. Default `[6, 5]`. */
  bob?: Vec2
  /** Draw without smoothing, texel for texel: pixel art. Default false. */
  pixelated?: boolean
  /**
   * The fraction of the screen's height, from the bottom, the view-model keeps clear: a status bar
   * the game draws there stays readable, and the weapon is cut off at the bar's top edge instead of
   * the screen's, as a status bar over it would cut it. 0 to 0.5; default 0.
   */
  clearBottom?: number
  /** The UI screen it registers. Default `"viewmodel"`. */
  screen?: string
  /** The input context the game plays in; the view-model is put up only while it is live. Default `"gameplay"`. */
  gameplayContext?: string
}
```

Import: `import type { ViewModelConfig } from "@argus/gameplay"`

## Members

| Member | Signature | Description |
|---|---|---|
| `frames` | `frames: Record<string, ViewModelFrame>` | Frames by name. |
| `show` | `show?: string[]` | The frames drawn at the start. Default the first one. |
| `virtualSize` | `virtualSize?: Vec2` | The virtual canvas, in pixels. Default 320 × 200. |
| `anchor` | `anchor?: Vec2` | Where every frame's pivot lands on the canvas, in virtual pixels. Default bottom-centre. |
| `scale` | `scale?: number` | Virtual pixels per source pixel. Default 1. |
| `bob` | `bob?: Vec2` | Virtual pixels the bob swings sideways and dips at full walking speed. Default `[6, 5]`. |
| `pixelated` | `pixelated?: boolean` | Draw without smoothing, texel for texel: pixel art. Default false. |
| `clearBottom` | `clearBottom?: number` | The fraction of the screen's height, from the bottom, the view-model keeps clear: a status bar the game draws there stays readable, and the weapon is cut off at the bar's top edge instead of the screen's, as a status bar over it would cut it. 0 to 0.5; default 0. |
| `screen` | `screen?: string` | The UI screen it registers. Default `"viewmodel"`. |
| `gameplayContext` | `gameplayContext?: string` | The input context the game plays in; the view-model is put up only while it is live. Default `"gameplay"`. |
