Skip to content

CameraBinding

Defined in: renderer/src/CameraComponent.ts:69

Binding that associates a camera with a named render layer.

Each ratio is a linear blend from identity (0) to full camera effect (1), applied independently per axis. Defaults are all 1, giving the classic “this layer follows the camera” behavior.

Common recipes:

  • Parallax: translateRatio: 0.5 (half the camera’s translation).
  • Dampened zoom, still upright: rotateRatio: 0, scaleRatio: 0.3.

A ratio below 1 scales the layer by less than the camera does while the layer still translates by the full camera offset, so content drifts away from the world position it should sit on as the zoom leaves 1. For UI that must track a world point at constant size, use ScreenFollow, which projects the point through the camera every frame.

layer: string

Defined in: renderer/src/CameraComponent.ts:71

Layer name to transform.


optional rotateRatio?: number

Defined in: renderer/src/CameraComponent.ts:75

Rotation follow factor. 0 = stay upright, 1 = full camera rotation. Default: 1.


optional scaleRatio?: number

Defined in: renderer/src/CameraComponent.ts:77

Zoom follow factor. 0 = constant size, 1 = full camera zoom. Default: 1.


optional translateRatio?: number

Defined in: renderer/src/CameraComponent.ts:73

Translation follow factor. 0 = stay at world origin, 1 = full. Default: 1.

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/renderer.md.