Talos docs

ViewModelConfig

Since 0.6
Plain text

Signature

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

MemberSignatureDescription
framesframes: Record<string, ViewModelFrame>Frames by name.
showshow?: string[]The frames drawn at the start. Default the first one.
virtualSizevirtualSize?: Vec2The virtual canvas, in pixels. Default 320 × 200.
anchoranchor?: Vec2Where every frame's pivot lands on the canvas, in virtual pixels. Default bottom-centre.
scalescale?: numberVirtual pixels per source pixel. Default 1.
bobbob?: Vec2Virtual pixels the bob swings sideways and dips at full walking speed. Default [6, 5].
pixelatedpixelated?: booleanDraw without smoothing, texel for texel: pixel art. Default false.
clearBottomclearBottom?: numberThe 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.
screenscreen?: stringThe UI screen it registers. Default "viewmodel".
gameplayContextgameplayContext?: stringThe input context the game plays in; the view-model is put up only while it is live. Default "gameplay".