Class: TerminateOutOfBounds

hcje/sprites.TerminateOutOfBounds(sprite, bounds, killopt)

Adjuster that completes when the sprite is out of bounds. When the target is fully out of the boundary, the adjuster is marked as complete and the target sprite is set to be stationary.

Constructor

new TerminateOutOfBounds(sprite, bounds, killopt)

Construct the adjuster

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

The target sprite.

bounds module:hcje/utils~RectData

Game area bounds.

kill boolean <optional>
false

If true, the sprite is killed on completion.

Source:

Extends

Members

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

The underlying sprite.

Type:
Overrides:
Source:

onCompletion :module:hcje/sprites~onAdjustmentComplete

Type:
Overrides:
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.

Overrides:
Source:

isComplete() → {boolean}

Get completion state.

Overrides:
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.

Overrides:
Source: