On this page

# Animator

Class Animator controls running of a function.

## Constructor

### new Animator(fcn, steps, fps)

Sets parameters, then calls start(). To have the model not start immediately do:

- const anim = new Animator(<args>).stop()

Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`fcn` | function |  | The function the animator runs and controls
`steps` | number |  | How many steps to run. Default is -1, forever
`fps` | number | 30 | Max frames/second to run. Default is 30

Source
  - Animator.js, line 6

## Methods

### start()

Starts the model running

Source
  - Animator.js, line 25

Returns:

The animator, allows chaining

### stop()

Stops the model running

Source
  - Animator.js, line 36

Returns:

The animator, allows chaining

Type anything to view search result