Class: Timeline

Phaser.Tweens. Timeline

[description]


new Timeline(manager)

Parameters:
Name Type Description
manager Phaser.Tweens.TweenManager

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 12)

Extends

Members


completeDelay :number

Time in ms/frames before the 'onComplete' event fires. This never fires if loop = true (as it never completes)

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/tweens/Timeline.js (Line 125)

countdown :number

Countdown timer (used by loopDelay and completeDelay)

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/tweens/Timeline.js (Line 135)

data :array

An array of Tween objects, each containing a unique property and target being tweened.

Type:
  • array
Since: 3.0.0
Default Value:
  • []
Source: src/tweens/Timeline.js (Line 53)

duration :number

Time in ms/frames for the whole Tween to play through once, excluding loop amounts and loop delays.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/tweens/Timeline.js (Line 194)

elapsed :number

Elapsed time in ms/frames of this run through the Tween.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/tweens/Timeline.js (Line 174)

isTimeline :boolean

[description]

Type:
  • boolean
Since: 3.0.0
Default Value:
  • true
Source: src/tweens/Timeline.js (Line 43)

loop :number

Loop this tween? Can be -1 for an infinite loop, or an integer.
When enabled it will play through ALL TweenDatas again (use TweenData.repeat to loop a single TD)

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/tweens/Timeline.js (Line 94)

loopCounter :number

How many loops are left to run?

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/tweens/Timeline.js (Line 115)

loopDelay :number

Time in ms/frames before the tween loops.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/tweens/Timeline.js (Line 105)

manager :Phaser.Tweens.TweenManager

[description]

Type:
Since: 3.0.0
Source: src/tweens/Timeline.js (Line 34)

paused :boolean

Does the Tween start off paused? (if so it needs to be started with Tween.play)

Type:
  • boolean
Since: 3.0.0
Default Value:
  • false
Source: src/tweens/Timeline.js (Line 164)

progress :number

Value between 0 and 1. The amount through the Tween, excluding loops.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/tweens/Timeline.js (Line 204)

state :integer

The current state of the tween

Type:
  • integer
Since: 3.0.0
Source: src/tweens/Timeline.js (Line 145)

timeScale :number

Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on.
Value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only.

Type:
  • number
Since: 3.0.0
Default Value:
  • 1
Source: src/tweens/Timeline.js (Line 83)

totalData :number

data array doesn't usually change, so we can cache the length

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/tweens/Timeline.js (Line 63)

totalDuration :number

Time in ms/frames for all Tweens to complete (including looping)

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/tweens/Timeline.js (Line 214)

totalElapsed :number

Total elapsed time in ms/frames of the entire Tween, including looping.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/tweens/Timeline.js (Line 184)

totalProgress :number

Value between 0 and 1. The amount through the entire Tween, including looping.

Type:
  • number
Since: 3.0.0
Default Value:
  • 0
Source: src/tweens/Timeline.js (Line 224)

useFrames :boolean

If true then duration, delay, etc values are all frame totals.

Type:
  • boolean
Since: 3.0.0
Default Value:
  • false
Source: src/tweens/Timeline.js (Line 73)

Methods


add(config)

[description]

Parameters:
Name Type Description
config object

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 289)
Returns:

This Timeline object.

Type
Phaser.Tweens.Timeline

addListener(event, fn [, context])

Add a listener for a given event.

Parameters:
Name Type Argument Default Description
event string | symbol

The event name.

fn function

The listener function.

context * <optional>
this

The context to invoke the listener with.

Since: 3.0.0
Inherited From:
Source: src/events/EventEmitter.js (Line 111)
Returns:

this.

Type
Phaser.Events.EventEmitter

calcDuration()

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 418)

destroy()

Stops all the Tweens in the Timeline immediately, whatever stage of progress they are at and flags them for removal by the TweenManager.

Since: 3.0.0
Overrides:
Source: src/tweens/Timeline.js (Line 846)

emit(event [, args])

Calls each of the listeners registered for a given event.

Parameters:
Name Type Argument Description
event string | symbol

The event name.

args * <optional>
<repeatable>

Additional arguments that will be passed to the event handler.

Since: 3.0.0
Inherited From:
Source: src/events/EventEmitter.js (Line 86)
Returns:

true if the event had listeners, else false.

Type
boolean

eventNames()

Return an array listing the events for which the emitter has registered listeners.

Since: 3.0.0
Inherited From:
Source: src/events/EventEmitter.js (Line 55)
Returns:
Type
array

getRelativeOffset(value, base)

[description]

Parameters:
Name Type Description
value string

[description]

base number

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 386)
Returns:

[description]

Type
number

getTimeScale()

Gets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on.

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 263)
Returns:

The value of the time scale applied to this Tween.

Type
number

hasOffset(tween)

[description]

Parameters:
Name Type Description
tween Phaser.Tweens.Tween

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 329)
Returns:

[description]

Type
boolean

hasTarget(target)

[description]

Parameters:
Name Type Description
target object

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 823)
Returns:

[description]

Type
boolean

init()

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 481)
Returns:

[description]

Type
boolean

isOffsetAbsolute(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 344)
Returns:

[description]

Type
boolean

isOffsetRelative(value)

[description]

Parameters:
Name Type Description
value string

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 359)
Returns:

[description]

Type
boolean

isPlaying()

Check whether or not the Timeline is playing.

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 276)
Returns:

true if this Timeline is active, otherwise false.

Type
boolean

listenerCount(event)

Return the number of listeners listening to a given event.

Parameters:
Name Type Description
event string | symbol

The event name.

Since: 3.0.0
Inherited From:
Source: src/events/EventEmitter.js (Line 75)
Returns:

The number of listeners.

Type
number

listeners(event)

Return the listeners registered for a given event.

Parameters:
Name Type Description
event string | symbol

The event name.

Since: 3.0.0
Inherited From:
Source: src/events/EventEmitter.js (Line 64)
Returns:

The registered listeners.

Type
array

makeActive(tween)

Delegates #makeActive to the Tween manager.

Parameters:
Name Type Description
tween Phaser.Tweens.Tween

The tween object to make active.

Since: 3.3.0
Source: src/tweens/Timeline.js (Line 549)
Returns:

The Timeline's Tween Manager object.

Type
Phaser.Tweens.TweenManager

nextState()

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 602)

off(event, fn, context, once)

Remove the listeners of a given event.

Parameters:
Name Type Description
event string | symbol

The event name.

fn function

Only remove the listeners that match this function.

context *

Only remove the listeners that have this context.

once boolean

Only remove one-time listeners.

Since: 3.0.0
Inherited From:
Source: src/events/EventEmitter.js (Line 151)
Returns:

this.

Type
Phaser.Events.EventEmitter

on(event, fn [, context])

Add a listener for a given event.

Parameters:
Name Type Argument Default Description
event string | symbol

The event name.

fn function

The listener function.

context * <optional>
this

The context to invoke the listener with.

Since: 3.0.0
Inherited From:
Source: src/events/EventEmitter.js (Line 98)
Returns:

this.

Type
Phaser.Events.EventEmitter

once(event, fn [, context])

Add a one-time listener for a given event.

Parameters:
Name Type Argument Default Description
event string | symbol

The event name.

fn function

The listener function.

context * <optional>
this

The context to invoke the listener with.

Since: 3.0.0
Inherited From:
Source: src/events/EventEmitter.js (Line 124)
Returns:

this.

Type
Phaser.Events.EventEmitter

pause()

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 775)
Returns:

This Timeline object.

Type
Phaser.Tweens.Timeline

play()

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 564)

queue(tween)

[description]

Parameters:
Name Type Description
tween Phaser.Tweens.Tween

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 304)
Returns:

This Timeline object.

Type
Phaser.Tweens.Timeline

removeAllListeners( [event])

Remove all listeners, or those of the specified event.

Parameters:
Name Type Argument Description
event string | symbol <optional>

The event name.

Since: 3.0.0
Inherited From:
Source: src/events/EventEmitter.js (Line 165)
Returns:

this.

Type
Phaser.Events.EventEmitter

removeListener(event, fn, context, once)

Remove the listeners of a given event.

Parameters:
Name Type Description
event string | symbol

The event name.

fn function

Only remove the listeners that match this function.

context *

Only remove the listeners that have this context.

once boolean

Only remove one-time listeners.

Since: 3.0.0
Inherited From:
Source: src/events/EventEmitter.js (Line 137)
Returns:

this.

Type
Phaser.Events.EventEmitter

resetTweens(resetFromLoop)

[description]

Parameters:
Name Type Description
resetFromLoop boolean

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 508)

resume()

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 801)
Returns:

This Timeline object.

Type
Phaser.Tweens.Timeline

setCallback(type, callback [, params] [, scope])

Sets a callback for the Tween Manager.

Parameters:
Name Type Argument Description
type string

[description]

callback function

[description]

params array <optional>

[description]

scope object <optional>

[description]

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 526)
Returns:

This Timeline object.

Type
Phaser.Tweens.Timeline

setTimeScale(value)

Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on.
Value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only.

Parameters:
Name Type Description
value number

The time scale value to set.

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 245)
Returns:

This Timeline object.

Type
Phaser.Tweens.Timeline

shutdown()

Removes all listeners.

Since: 3.0.0
Inherited From:
Source: src/events/EventEmitter.js (Line 31)

stop()

Stops the Tween immediately, whatever stage of progress it is at and flags it for removal by the TweenManager.

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 764)

update(timestamp, delta)

Returns 'true' if this Timeline has finished and should be removed from the Tween Manager.
Otherwise, returns false.

Parameters:
Name Type Description
timestamp number

[description]

delta number

The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.

Since: 3.0.0
Source: src/tweens/Timeline.js (Line 662)
Returns:

Returns true if this Timeline has finished and should be removed from the Tween Manager.

Type
boolean