Class: BaseSpriteAdjuster

hcje/sprites.BaseSpriteAdjuster(sprite)

Base adjuster. An adjuster is an object that can manipulate a Sprite.The base adjuster's adjust method does nothing and is expected to be overridden. Unlike a DynamicsLimiter, adjusters normally have a limited lifetime and can call a completion function, set by the onCompletion property, when its activity has completed.

Constructor

new BaseSpriteAdjuster(sprite)

Construct base adjuster.

Parameters:
Name Type Description
sprite module:hcje/sprites.Sprite

The target sprite.

Source:

Members

(protected) _sprite :module:hcje/sprites.Sprite

The underlying sprite.

Type:
Source:

onCompletion :module:hcje/sprites~onAdjustmentComplete

Type:
Source:

Methods

adjust(timeStamp, deltaT)

Perform the adjustment. This method will be called in the animation cycle.

Parameters:
Name Type Description
timeStamp DOMHighResTimeStamp

Current time stamp in ms.

deltaT number

Change in time in seconds.

Source:

isComplete() → {boolean}

Get completion state.

Source:
Returns:
Type
boolean

markComplete(reason)

Set as complete.

Parameters:
Name Type Description
reason *

Reason for completion. This is passed to the onCompletion callback if provided.

Source: