Phaser API Documentation

  Version: 
NumberTweenBuilderConfig
Properties:
name type arguments Default description
from number <optional> 0

The start number.

to number <optional> 1

The end number.

delay number <optional> 0

The number of milliseconds to delay before the counter will start.

duration number <optional> 1000

The duration of the counter in milliseconds.

ease string | function <optional> 'Power0'

The easing equation to use for the counter.

easeParams array <optional>

Optional easing parameters.

hold number <optional> 0

The number of milliseconds to hold the counter for before yoyo'ing.

repeat number <optional> 0

The number of times to repeat the counter.

repeatDelay number <optional> 0

The number of milliseconds to pause before the counter will repeat.

yoyo boolean <optional> false

Should the counter play forward to the end value and then backwards to the start? The reverse playback will also take duration milliseconds to complete.

completeDelay string | number | function | object | array <optional> 0

The time the counter will wait before the onComplete event is dispatched once it has completed, in ms.

loop string | number | function | object | array <optional> 0

The number of times the counter will repeat. (A value of 1 means the counter will play twice, as it repeated once.)

loopDelay string | number | function | object | array <optional> 0

The time the counter will pause before starting either a yoyo or returning to the start for a repeat.

paused boolean <optional> false

Does the counter start in a paused state (true) or playing (false)?

callbackScope any <optional>

Scope (this) for the callbacks. The default scope is the counter.

onComplete Phaser.Types.Tweens.TweenOnCompleteCallback <optional>

A function to call when the counter completes.

onCompleteParams array <optional>

Additional parameters to pass to onComplete.

onLoop Phaser.Types.Tweens.TweenOnLoopCallback <optional>

A function to call each time the counter loops.

onLoopParams array <optional>

Additional parameters to pass to onLoop.

onRepeat Phaser.Types.Tweens.TweenOnRepeatCallback <optional>

A function to call each time the counter repeats.

onRepeatParams array <optional>

Additional parameters to pass to onRepeat.

onStart Phaser.Types.Tweens.TweenOnStartCallback <optional>

A function to call when the counter starts.

onStartParams array <optional>

Additional parameters to pass to onStart.

onStop Phaser.Types.Tweens.TweenOnStopCallback <optional>

A function to call when the counter is stopped.

onStopParams array <optional>

Additional parameters to pass to onStop.

onUpdate Phaser.Types.Tweens.TweenOnUpdateCallback <optional>

A function to call each time the counter steps.

onUpdateParams array <optional>

Additional parameters to pass to onUpdate.

onYoyo Phaser.Types.Tweens.TweenOnYoyoCallback <optional>

A function to call each time the counter yoyos.

onYoyoParams array <optional>

Additional parameters to pass to onYoyo.

onPause Phaser.Types.Tweens.TweenOnPauseCallback <optional>

A function to call when the counter is paused.

onPauseParams array <optional>

Additional parameters to pass to onPause.

onResume Phaser.Types.Tweens.TweenOnResumeCallback <optional>

A function to call when the counter is resumed after being paused.

onResumeParams array <optional>

Additional parameters to pass to onResume.

persist boolean <optional>

Will the counter be automatically destroyed on completion, or retained for future playback?

interpolation string | function <optional>

The interpolation function to use if the value given is an array of numbers.

Type:
object
Since: 3.18.0