Skip to content

Functions

Caleb Sacks edited this page Aug 7, 2020 · 5 revisions

Overview

A function is a type of Vidar property that is evaluated every frame.

Basic Examples

// the layer's `x` property will always be one tenth of the time elapsed
options.x = (layer, reltime) => 0.1 * reltime;
// the element's opacity will be randomized each animation frame
options.opacity = (layer, reltime) => Math.random();

Callback

The value of this property is a function that is passed two arguments, element and reltime.

Argument Description
element the movie or layer that to which the property belongs to
reltime the time relative to that element as a DOMHighResTimeStamp
Clone this wiki locally