Appearance
Wiggle API / Builder
Interface: Builder
Properties
center
readonlycenter: [number,number]
The canvas center, in pixels.
fps
readonlyfps:number
height
readonlyheight:number
width
readonlywidth:number
Methods
add()
add<
T>(node):T
Add a node or group to the composition and return it.
Type Parameters
T
Parameters
node
T
Returns
T
audio()
audio(
path,options?):void
Add a music bed under the whole composition. gain is the held volume (0..1); the volume ramps up over fadeIn and down over fadeOut.
Parameters
path
string
options?
fadeIn?
fadeOut?
gain?
number
Returns
void
group()
group(
options?):Group
Create a group, positioned at the canvas center unless given x and y.
Parameters
options?
x?
number
y?
number
Returns
scene()
scene(
duration,build):void
Add a scene that plays for duration. Scenes play in order. Calling scene() puts the composition in scene mode and the total duration is the sum of the scenes minus the transition overlaps.
Parameters
duration
build
(s) => void
Returns
void
transition()
transition(
options?):void
Place a transition before the next scene, overlapping it with the previous scene. Default "slide" over 0.5s.
Parameters
options?
duration?
type?
"slide" | "fade"
Returns
void