Camera2D

class Camera2D(wander: Float = 0.1f, punch: Float = 0.1f, roll: Float = 0.1f, shake: Float = 0.004f, cuts: Boolean = true, minZoom: Float = 0.94f, maxZoom: Float = 1.3f, seed: Int = 1)

Moves a whole flat drawing, the way CameraRig moves a flight.

A wander, a zoom punch on the kick (early, when the queue shows it coming), a nudge on the snare, a roll, a whip on a drop, and now and then a cut to a new framing at a supported section boundary. Pans are shares of the screen, angle is radians.

Constructors

Link copied to clipboard
constructor(wander: Float = 0.1f, punch: Float = 0.1f, roll: Float = 0.1f, shake: Float = 0.004f, cuts: Boolean = true, minZoom: Float = 0.94f, maxZoom: Float = 1.3f, seed: Int = 1)

Properties

Link copied to clipboard
Link copied to clipboard

Radius of a slow orbit, as a share of the screen. Zero leaves it off.

Link copied to clipboard

Laps per four-pulse visual cycle when rhythm is usable.

Link copied to clipboard
var panX: Float
Link copied to clipboard
var panY: Float
Link copied to clipboard
var zoom: Float

Functions

Link copied to clipboard

Moves the camera on by one frame. The same state twice moves it once. A new frame at an instant already drawn still applies its hits, without adding elapsed time.

Link copied to clipboard
fun project(x: Float, y: Float, aspect: Float, parallax: Float, into: Anchor)

Where a point at x, y (shares of the screen, before the camera) lands on screen, as shares. aspect is width over height. Answers into into.

Link copied to clipboard
fun reset()
Link copied to clipboard
fun shove(amount: Float)

Pushes the zoom the way a kick does, for a drawing's own hits.