Class

ClassicStroke

ClassicStroke(bottom, top, speed, shape)

Constructor

# new ClassicStroke(bottom, top, speed, shape)

Create a new ClassicStroke.

Parameters:
Name Type Description
bottom Number | Array | function

bottom of the stroke, array of bottoms, or a function that computes the bottom for each down stroke

top Number | Array | function

top of the stroke, array of tops, or a function that computes the top for each up stroke

speed Number | Array | function

speed of the stroke, array of speeds, or a function that computes the speed for each stroke

shape function | Array

a value provider for the shape or an even-lengthed array of value providers

View Source behaviors/classic-stroke.js, line 79

Example
// Bounce stroke.
ayva.do(new ClassicStroke(0, 1, 1, [ Ayva.RAMP_NEGATIVE_PARABOLIC, Ayva.RAMP_PARABOLIC ]));

ClassicStroke(config)

So named for its timelessness. The OG stroke. Simple up and down movement with some (optional) variation on a few parameters such as speed, positions, shape, and twist.

A classic stroke consists of a single function action that computes and inserts a move to either the top or the bottom of the stroke based on where the device is currently located, and what the most recent movement along the stroke axis was.

See the Classic Stroke Tutorial.

Constructor

# new ClassicStroke(config)

Create a new ClassicStroke.

Parameters:
Name Type Description
config Object

stroke configuration

View Source behaviors/classic-stroke.js, line 16

Example
ayva.do(new ClassicStroke({
  bottom: 0,
  top: 1,
  speed: 1,
}));