# Tween

Allows tweening `Object` properties between two states for a given duration. To tween properties on Paper.js `Item` instances, `item.tween(from, to, options)` can be used, which returns created tween instance.

## Constructors

`Tween(object, from, to, duration[, easing[, start]])`

Creates a new tween.

#### Parameters:

- `object:` `Object` — the object to tween the properties on
- `from:` `Object` — the state at the start of the tweening
- `to:` `Object` — the state at the end of the tweening
- `duration:` `Number` — the duration of the tweening
- `easing:` `String`⟋`Function` — the type of the easing function or the easing function — optional, default: `‘linear’`
- `start:` `Boolean` — whether to start tweening automatically — optional, default: `true`

#### Returns:

- ``Tween`` — the newly created tween

## Properties

### Event Handlers

`onUpdate`

The function to be called when the tween is updated. It receives an object as its sole argument, containing the current progress of the tweening and the factor calculated by the easing function.

#### Type:

- `Function`⟋`null`

#### Example:Display tween progression values:

Run

## Methods

`then(function)`

Set a function that will be executed when the tween completes.

#### Parameters:

- `function:` `Function` — the function to execute when the tween completes

#### Returns:

- ``Tween``

#### Example:Tweens chaining:

Run
`start()`

Start tweening.

#### Returns:

- ``Tween``

#### Example:Manually start tweening.

Run
`stop()`

Stop tweening.

#### Returns:

- ``Tween``

#### Example:Stop a tween before it completes.

Run