Class: TweenManager

Phaser. TweenManager

Phaser.Game has a single instance of the TweenManager through which all Tween objects are created and updated. Tweens are hooked into the game clock and pause system, adjusting based on the game state.

TweenManager is based heavily on tween.js by http://soledadpenades.com. The difference being that tweens belong to a games instance of TweenManager, rather than to a global TWEEN object. It also has callbacks swapped for Signals and a few issues patched with regard to properties and completion errors. Please see https://github.com/sole/tween.js for a full list of contributors.

new TweenManager(game)

Phaser - TweenManager

Parameters:
Name Type Description
game Phaser.Game

A reference to the currently running game.

Source:

Members

game

Properties:
Name Type Description
game Phaser.Game

Local reference to game.

Source:

REVISION

Version number of this library.

Properties:
Name Type Description
REVISION string
Default Value:
  • "11dev"
Source:

Methods

add(tween) → {Phaser.Tween}

Add a new tween into the TweenManager.

Parameters:
Name Type Description
tween Phaser.Tween

The tween object you want to add.

Source:
Returns:

The tween object you added to the manager.

Type
Phaser.Tween

create(object) → {Phaser.Tween}

Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite.

Parameters:
Name Type Description
object Object

Object the tween will be run on.

Source:
Returns:

The newly created tween object.

Type
Phaser.Tween

getAll() → {Phaser.Tween[]}

Get all the tween objects in an array.

Source:
Returns:

Array with all tween objects.

Type
Phaser.Tween[]

isTweening(object) → {boolean}

Checks to see if a particular Sprite is currently being tweened.

Parameters:
Name Type Description
object object

The object to check for tweens against.

Source:
Returns:

Returns true if the object is currently being tweened, false if not.

Type
boolean

remove(tween)

Remove a tween from this manager.

Parameters:
Name Type Description
tween Phaser.Tween

The tween object you want to remove.

Source:

removeAll()

Remove all tween objects.

Source:

resumeAll()

Pauses all currently paused tweens.

Source:

update() → {boolean}

Update all the tween objects you added to this manager.

Source:
Returns:

Return false if there's no tween to update, otherwise return true.

Type
boolean

update()

Pauses all currently running tweens.

Source:
Phaser Copyright © 2012-2013 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Thu Nov 28 2013 15:56:35 GMT-0000 (GMT) using the DocStrap template.