Class: CameraAutoZoom

rune.camera.CameraAutoZoom(camera)

Fits the camera's targets and a world-space margin inside its viewport. Zoom is clamped to configurable limits and optionally smoothed over time. The controller is disabled by default. Disabling it, or removing all targets, preserves the current zoom. Limits take precedence over fitting all targets.

Constructor

new CameraAutoZoom(camera)

Creates a camera's automatic zoom controller.
Parameters:
Name Type Description
camera rune.camera.Camera The owning camera.
Source:

Members

enabled :boolean

Whether automatic zoom and bounds-centered following are enabled.
Type:
  • boolean
Default Value:
  • false
Source:

max :number

Maximum zoom, clamped between min and 4. Higher values show targets closer up.
Type:
  • number
Default Value:
  • 4.0
Source:

min :number

Minimum zoom, clamped between 0.25 and max. Lower values show more of the world.
Type:
  • number
Default Value:
  • 0.25
Source:

padding :number

Margin on each side of the target bounds in world pixels, clamped to zero.
Type:
  • number
Default Value:
  • 32
Source:

(readonly) position :rune.geom.Point

The last calculated target bounds center, in stage-local world coordinates. Updated by the camera before following its targets. Treat as read-only.
Type:
Source:

smoothing :number

Smoothing time constant in milliseconds, clamped to zero. Zero fits instantly. About 63 percent of the remaining zoom difference is covered in this time.
Type:
  • number
Default Value:
  • 250
Source: