Talos docs

CameraComponent

Since 0.6
Plain text

Signature

export interface CameraComponent {
  type: "camera"
  kind: CameraKind
  fov: number
  primary?: boolean
  target?: string
  distance?: number
  /** How far this camera sees, in metres; absent, the far plane is derived from `meta.bounds`. */
  far?: number
  /** "perspective" (absent) or "orthographic"; orthographic ignores `fov`. */
  projection?: "perspective" | "orthographic"
  /** Orthographic half-height in world units, above zero. */
  orthoSize?: number
  /** Orthographic: screen pixels per world unit, above zero. */
  pixelsPerUnit?: number
  /** Orthographic: round the camera position to the pixel grid. */
  pixelSnap?: boolean
  /** Screen cameras compete: highest priority is the view. Default 0. */
  priority?: number
  /** Draw only entities on these layers; not with `hideLayers`. */
  layers?: string[]
  /** Draw every layer except these; not with `layers`. */
  hideLayers?: string[]
  /** "screen" (default), "overlay" (over the screen view, depth cleared) or "viewport" (into `viewport`). */
  output?: "screen" | "overlay" | "viewport"
  /** [x, y, width, height] as 0..1 fractions of the window; for `output: "viewport"` only. */
  viewport?: [number, number, number, number]
  /** Draw order among overlay and viewport cameras, lowest first. Default 0. */
  order?: number
  /** How the view blends to this camera when it becomes the screen view; absent, a cut. */
  blendIn?: CameraBlend
  /** Opt-in engine-driven rig of this camera's `kind`; present, even `{}`, turns it on. */
  rig?: CameraRigSettings
}

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

Members

MemberSignatureDescription
typetype: "camera"
kindkind: CameraKind
fovfov: number
primaryprimary?: boolean
targettarget?: string
distancedistance?: number
farfar?: numberHow far this camera sees, in metres; absent, the far plane is derived from meta.bounds.
projectionprojection?: "perspective" | "orthographic""perspective" (absent) or "orthographic"; orthographic ignores fov.
orthoSizeorthoSize?: numberOrthographic half-height in world units, above zero.
pixelsPerUnitpixelsPerUnit?: numberOrthographic: screen pixels per world unit, above zero.
pixelSnappixelSnap?: booleanOrthographic: round the camera position to the pixel grid.
prioritypriority?: numberScreen cameras compete: highest priority is the view. Default 0.
layerslayers?: string[]Draw only entities on these layers; not with hideLayers.
hideLayershideLayers?: string[]Draw every layer except these; not with layers.
outputoutput?: "screen" | "overlay" | "viewport""screen" (default), "overlay" (over the screen view, depth cleared) or "viewport" (into viewport).
viewportviewport?: [number, number, number, number][x, y, width, height] as 0..1 fractions of the window; for output: "viewport" only.
orderorder?: numberDraw order among overlay and viewport cameras, lowest first. Default 0.
blendInblendIn?: CameraBlendHow the view blends to this camera when it becomes the screen view; absent, a cut.
rigrig?: CameraRigSettingsOpt-in engine-driven rig of this camera's kind; present, even {}, turns it on.