Skip to main content

Type Alias: Camera2DAspectMode

Camera2DAspectMode = "fill" | "contain"

Defined in: core/Camera.ts:235

How Camera2D.setAspectRatio reconciles the user-set frame with the viewport's pixel aspect.

  • 'fill' (default): keep frameHeight, recompute frameWidth from the viewport aspect. Frame is cropped horizontally on wider viewports and over-shows on narrower ones. Back-compatible.
  • 'contain': keep both base frameWidth and frameHeight. Grow whichever dimension is needed to letterbox so the user's full frame is always visible (no cropping of the intended view).