zoom() — move the view to an object

zoom() is a camera move. It zooms the score to a level and brings an object to the middle of the screen, smoothly, over a duration.

zoom(to:polaris, scale:6, dur:4)

Over four seconds the view zooms to 600% and pans until the element polaris sits in the centre.


Arguments

Argument Meaning
to id or uid of the object to centre on. Left out, the point now in the middle of the screen stays there: a plain zoom.
scale Zoom level, as in the zoom readout: 1 is the fitted score, 4 is 400%. Left out, the level stays: a pan only.
dur Seconds for the move. 0 jumps. Default 2.
ease easeInOutSine (default), easeInOutCubic, easeOutCubic or linear.
next A cue to run when the move ends — see Chaining below.
home home:1 goes back to the normal view: zoom 1 (or scale:), the playhead where it sat before the first zoom() moved it, no pan.

trig: and uid: work as on every cue; by default the playhead fires it.


It moves the view, not the time

In scroll mode the view along the scroll axis is set by where the playhead sits on the screen. zoom() moves that: the playhead line slides with the score, off the screen if the object is far from it, while playback time stays where it was. If the score is playing it carries on scrolling from the new view. Across the axis it uses the zoom pan.

Both are local view settings, like the toolbar zoom: every client that runs the cue makes the same move on its own screen, and a reload returns to the view you had saved.

The object is followed during the move, so something that is itself moving — a star on a rotating sky, material in a score that is playing — still ends up centred.


Chaining

A cue that knows when it has finished can hand over to the next with next:. text() and zoom() do:

text(reveal:polaris.txt, target:self, next:"zoom(to:polaris, scale:6, dur:4)")
zoom(to:polaris, scale:6, dur:4, next:"zoom(to:pole, scale:1, dur:8)")

The value is either

A text that is stopped, clicked away or replaced does not run its next.


Demo project

demo-zoom (Demos → Animation): press play and the playhead fires six red flags along the timeline —

  1. zoom(to:sec-map, scale:1.6, dur:3) — an overview
  2. zoom(to:sec-poem, scale:7, dur:4) — a small poem you cannot read at fit
  3. zoom(to:sec-micro, scale:20, dur:5) — a spiral 34 units across
  4. zoom(to:sec-wide, scale:0.5, dur:4) — the whole panorama, smaller than the screen
  5. a tour of three stars chained with next:, each with its own zoom level
  6. zoom(home:1, dur:4) — back to the normal view

See also

Tip: use ← → or ↑ ↓ to navigate the docs