Namespace: Builders

Phaser.Tweens. Builders

Methods


<static> GetBoolean(source, key, defaultValue)

Retrieves the value of the given key from an object.

Parameters:
Name Type Description
source object

The object to retrieve the value from.

key string

The key to look for in the source object.

defaultValue *

The default value to return if the key doesn't exist or if no source object is provided.

Since: 3.0.0
Source: src/tweens/builders/GetBoolean.js (Line 7)
Returns:

The retrieved value.

Type
*

<static> GetEaseFunction(ease, easeParams)

[description]

Parameters:
Name Type Description
ease string | function

[description]

easeParams array

[description]

Since: 3.0.0
Source: src/tweens/builders/GetEaseFunction.js (Line 9)
Returns:

[description]

Type
function

<static> GetNewValue(source, key, defaultValue)

[description]

Parameters:
Name Type Description
source object

[description]

key string

[description]

defaultValue *

[description]

Since: 3.0.0
Source: src/tweens/builders/GetNewValue.js (Line 7)
Returns:

[description]

Type
function

<static> GetProps(config)

[description]

Parameters:
Name Type Description
config object

The configuration object of the tween to get the target(s) from.

Since: 3.0.0
Source: src/tweens/builders/GetProps.js (Line 9)
Returns:

An array of all the targets the tween is operating on.

Type
array

<static> GetTargets(config)

Extracts an array of targets from a Tween configuration object.

The targets will be looked for in a targets property. If it's a function, its return value will be used as the result.

Parameters:
Name Type Description
config object

The configuration object to use.

Since: 3.0.0
Source: src/tweens/builders/GetTargets.js (Line 9)
Returns:

An array of targets (may contain only one element), or null if no targets were specified.

Type
array

<static> GetTweens(config)

Returns an array of all tweens in the given config

Parameters:
Name Type Description
config object

[description]

Since: 3.0.0
Source: src/tweens/builders/GetTweens.js (Line 9)
Returns:

[description]

Type
array

<static> GetValueOp(key, propertyValue)

Returns getStart and getEnd functions for a Tween's Data based on a target property and end value.

If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. A string can be provided to specify a relative end value which consists of an operation (+= to add to the current value, -= to subtract from the current value, *= to multiply the current value, or /= to divide the current value) followed by its operand. A function can be provided to allow greater control over the end value; it will receive the target object being tweened, the name of the property being tweened, and the current value of the property as its arguments. If both the starting and the ending values need to be controlled, an object with getStart and getEnd callbacks, which will receive the same arguments, can be provided instead. If an object with a value property is provided, the property will be used as the effective value under the same rules described here.

Parameters:
Name Type Description
key string

The name of the property to modify.

propertyValue *

The ending value of the property, as described above.

Since: 3.0.0
Source: src/tweens/builders/GetValueOp.js (Line 31)
Returns:

An array of two functions, getStart and getEnd, which return the starting and the ending value of the property based on the provided value.

Type
function

<static> NumberTweenBuilder(parent, config, defaults)

[description]

Parameters:
Name Type Description
parent Phaser.Tweens.TweenManager | Phaser.Tweens.Timeline

[description]

config object

[description]

defaults Phaser.Types.Tweens.TweenConfigDefaults

[description]

Since: 3.0.0
Source: src/tweens/builders/NumberTweenBuilder.js (Line 17)
Returns:

[description]

Type
Phaser.Tweens.Tween

<static> TimelineBuilder(manager, config)

Builds a Timeline of Tweens based on a configuration object.

The configuration object (config) can have the following properties:

tweens - an array of tween configuration objects to create and add into the new Timeline, as described by TweenBuilder. If this doesn't exist or is empty, the Timeline will start off paused and none of the other configuration settings will be read. If it's a function, it will be called and its return value will be used as the array. targets - an array (or function which returns one) of default targets to which to apply the Timeline. Each individual Tween configuration can override this value. totalDuration - if specified, each Tween in the Timeline will get an equal portion of this duration, usually in milliseconds, by default. Each individual Tween configuration can override the Tween's duration. duration - if totalDuration is not specified, the default duration, usually in milliseconds, of each Tween which will be created. Each individual Tween configuration can override the Tween's duration. delay, easeParams, ease, hold, repeat, repeatDelay, yoyo, flipX, flipY - the default settings for each Tween which will be created, as specified by TweenBuilder. Each individual Tween configuration can override any of these values. completeDelay - if specified, the time to wait, usually in milliseconds, before the Timeline completes. loop - how many times the Timeline should loop, or -1 to loop indefinitely. loopDelay - the time, usually in milliseconds, between each loop paused - if true, the Timeline will start paused useFrames - if true, all duration in the Timeline will be in frames instead of milliseconds callbackScope - the default scope (this value) to use for each callback registered by the Timeline Builder. If not specified, the Timeline itself will be used. onStart - if specified, the onStart callback for the Timeline, called every time it starts playing onStartScope - the scope (this value) to use for the onStart callback. If not specified, the callbackScope will be used. onStartParams - additional arguments to pass to the onStart callback. The Timeline will always be the first argument. onUpdate - if specified, the onUpdate callback for the Timeline, called every frame it's active, regardless of its Tweens onUpdateScope - the scope (this value) to use for the onUpdate callback. If not specified, the callbackScope will be used. onUpdateParams - additional arguments to pass to the onUpdate callback. The Timeline will always be the first argument. onLoop - if specified, the onLoop callback for the Timeline, called every time it loops onLoopScope - the scope (this value) to use for the onLoop callback. If not specified, the callbackScope will be used. onLoopParams - additional arguments to pass to the onLoop callback. The Timeline will always be the first argument. onYoyo - if specified, the onYoyo callback for the Timeline, called every time it yoyos onYoyoScope - the scope (this value) to use for the onYoyo callback. If not specified, the callbackScope will be used. onYoyoParams - additional arguments to pass to the onYoyo callback. The first argument will always be null, while the Timeline will always be the second argument. onComplete - if specified, the onComplete callback for the Timeline, called after it completes onCompleteScope - the scope (this value) to use for the onComplete callback. If not specified, the callbackScope will be used. onCompleteParams - additional arguments to pass to the onComplete callback. The Timeline will always be the first argument.

Parameters:
Name Type Description
manager Phaser.Tweens.TweenManager

The Tween Manager to which the Timeline will belong.

config object

The configuration object for the Timeline, as described above.

Since: 3.0.0
Source: src/tweens/builders/TimelineBuilder.js (Line 19)
Returns:

The created Timeline.

Type
Phaser.Tweens.Timeline

<static> TweenBuilder(parent, config, defaults)

[description]

Parameters:
Name Type Description
parent Phaser.Tweens.TweenManager | Phaser.Tweens.Timeline

[description]

config object

[description]

defaults Phaser.Types.Tweens.TweenConfigDefaults

Tween configuration defaults. `

Properties:
Name Type Argument Default Description
targets object | Array.<object>

The object, or an array of objects, to run the tween on.

delay number <optional>
0

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

duration number <optional>
1000

The duration of the tween in milliseconds.

ease string <optional>
'Power0'

The easing equation to use for the tween.

easeParams array <optional>

Optional easing parameters.

hold number <optional>
0

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

repeat number <optional>
0

The number of times to repeat the tween.

repeatDelay number <optional>
0

The number of milliseconds to pause before a tween will repeat.

yoyo boolean <optional>
false

Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take duration milliseconds to complete.

flipX boolean <optional>
false

Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the flipX property.

flipY boolean <optional>
false

Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the flipY property. ` { targets: null, delay: 0, duration: 1000, ease: 'Power0', easeParams: null, hold: 0, repeat: 0, repeatDelay: 0, yoyo: false, flipX: false, flipY: false };

Since: 3.0.0
Source: src/tweens/builders/TweenBuilder.js (Line 19)
Returns:

[description]

Type
Phaser.Tweens.Tween