Skip to main content

Class: SplitScreenCamera

Defined in: src/core/CameraExtensions.ts:1083

SplitScreenCamera - A convenience class that wraps MultiCamera for split-screen comparison views.

Based on Python Manim's multi_camera module. Provides two Camera2D instances rendered side-by-side (horizontal split) or stacked (vertical split) with a configurable split ratio.

Constructors​

Constructor​

new SplitScreenCamera(options): SplitScreenCamera

Defined in: src/core/CameraExtensions.ts:1094

Create a new SplitScreenCamera.

Parameters​

options​

SplitScreenCameraOptions = {}

Configuration options

Returns​

SplitScreenCamera

Methods​

getLeftCamera()​

getLeftCamera(): Camera2D

Defined in: src/core/CameraExtensions.ts:1135

Get the left (or top) camera.

Returns​

Camera2D

The left Camera2D


getMultiCamera()​

getMultiCamera(): MultiCamera

Defined in: src/core/CameraExtensions.ts:1151

Get the underlying MultiCamera instance.

Returns​

MultiCamera

The MultiCamera managing the viewports


getRightCamera()​

getRightCamera(): Camera2D

Defined in: src/core/CameraExtensions.ts:1143

Get the right (or bottom) camera.

Returns​

Camera2D

The right Camera2D


getSplitDirection()​

getSplitDirection(): "horizontal" | "vertical"

Defined in: src/core/CameraExtensions.ts:1159

Get the current split direction.

Returns​

"horizontal" | "vertical"

'horizontal' or 'vertical'


getSplitRatio()​

getSplitRatio(): number

Defined in: src/core/CameraExtensions.ts:1167

Get the current split ratio.

Returns​

number

Split ratio between 0.01 and 0.99


setSplit()​

setSplit(direction): this

Defined in: src/core/CameraExtensions.ts:1176

Set the split direction.

Parameters​

direction​

'horizontal' for side-by-side, 'vertical' for stacked

"horizontal" | "vertical"

Returns​

this

this for chaining


setSplitRatio()​

setSplitRatio(ratio): this

Defined in: src/core/CameraExtensions.ts:1187

Set the split ratio.

Parameters​

ratio​

number

Position of the split (0-1). 0.5 = equal halves.

Returns​

this

this for chaining