Class: XTweener

XTweener()

new XTweener()

X-visual tween driving system.

Source:

Methods

(static) initween(cmp)

Parameters:
Name Type Description
cmp array | component
Source:

(static) isPlaying(cmpTweens, seqx) → {bool}

Helper to find out is the sequences is playing.

Parameters:
Name Type Description
cmpTweens CmpTweens
seqx int

sequnce index

Source:
Returns:

is playing

Type
bool

(static) pushTriggerings(start_or_follow, now, cmpStarter, resolvingBuff, withs)

Buffering triggering tweens by 'startWith' and 'followBy'. Triggering will started at next update, starting by startTriggered()

Parameters:
Name Type Description
start_or_follow const

STARTWITH | FOLLOWBY

now number

current time

cmpStarter CmpTween

component triggered the event

resolvingBuff object

all triggering tween are put into here

withs array.<(startWith|followBy)>

scripts array defining tweens to be started

Source:

(static) startSeq(cmpTweens, seqx)

Pause all animation sequences

Parameters:
Name Type Description
cmpTweens CmpTweens
seqx int

sequnce index

Source:

(static) startSeq(cmpTweens, seqx)

Start ALL animation sequences.

Parameters:
Name Type Description
cmpTweens CmpTweens
seqx int

sequnce index

Source:
See:

(static) startSeq(cmpTweens, seqx)

Start animation sequence

Parameters:
Name Type Description
cmpTweens CmpTweens
seqx int

sequnce index

Source:
See:
  • XTweener.startAll

(static) startTriggered(cmpTweens, triggerings, resolvingBuff,)

Start triggereds, recursively, return the 'triggerings' - in wich elements started successfully have been removed.

Parameters:
Name Type Description
cmpTweens CmpTweens

target tween components to be started

triggerings object

[in / out] {entity-id: triggering}, the triggering component description, where trigering is pushed by #pushTriggerings(): {seqx, starter, triggerAt: STARTWITH | FOLLOWBY}

resolvingBuff, object

the tweener.resolvingStarts, buffer for push other triggered recursively

Source:

(static) startTween(cmp, time)

Parameters:
Name Type Description
cmp CmpTween
time number
Source:

(static) updateTween(cmp, time, resolvingStarts) → {bool}

Update a Tween. Modified from TWEEN.update.

Debug Notes: twn.onStart is called in XTweener.updateTween, later than startTween, but isPlaying is set in startTween. So there are chance such that twn.isPlaying = true but e.Obj3.mi is not initialized.

Shall we revise Tween.js?

Parameters:
Name Type Description
cmp CmpTween

tween component

time number
resolvingStarts object
Source:
Returns:

always true (compitibility with TWEEN.js?)

Type
bool

(static) validate(entity) → {bool}

Validating the entity can be animized

Parameters:
Name Type Description
entity ECS.Entity
Source:
Returns:

ok or not

Type
bool

initTweens(ecs, entites)

Parameters:
Name Type Description
ecs ECS
entites Set
Source:

update(tick, entities)

Parameters:
Name Type Description
tick int
entities array.<Entity>
Source:

XTweener(ecs, x, startingTrigged)

new XTweener(ecs, x, startingTrigged)

Initialize all tweens.

Parameters:
Name Type Description
ecs ECS
x object

singleton

startingTrigged object

triggered buffer (Animizer found tweens should started)

Source:

Methods

(static) initween(cmp)

Parameters:
Name Type Description
cmp array | component
Source:

(static) isPlaying(cmpTweens, seqx) → {bool}

Helper to find out is the sequences is playing.

Parameters:
Name Type Description
cmpTweens CmpTweens
seqx int

sequnce index

Source:
Returns:

is playing

Type
bool

(static) pushTriggerings(start_or_follow, now, cmpStarter, resolvingBuff, withs)

Buffering triggering tweens by 'startWith' and 'followBy'. Triggering will started at next update, starting by startTriggered()

Parameters:
Name Type Description
start_or_follow const

STARTWITH | FOLLOWBY

now number

current time

cmpStarter CmpTween

component triggered the event

resolvingBuff object

all triggering tween are put into here

withs array.<(startWith|followBy)>

scripts array defining tweens to be started

Source:

(static) startSeq(cmpTweens, seqx)

Pause all animation sequences

Parameters:
Name Type Description
cmpTweens CmpTweens
seqx int

sequnce index

Source:

(static) startSeq(cmpTweens, seqx)

Start ALL animation sequences.

Parameters:
Name Type Description
cmpTweens CmpTweens
seqx int

sequnce index

Source:
See:

(static) startSeq(cmpTweens, seqx)

Start animation sequence

Parameters:
Name Type Description
cmpTweens CmpTweens
seqx int

sequnce index

Source:
See:
  • XTweener.startAll

(static) startTriggered(cmpTweens, triggerings, resolvingBuff,)

Start triggereds, recursively, return the 'triggerings' - in wich elements started successfully have been removed.

Parameters:
Name Type Description
cmpTweens CmpTweens

target tween components to be started

triggerings object

[in / out] {entity-id: triggering}, the triggering component description, where trigering is pushed by #pushTriggerings(): {seqx, starter, triggerAt: STARTWITH | FOLLOWBY}

resolvingBuff, object

the tweener.resolvingStarts, buffer for push other triggered recursively

Source:

(static) startTween(cmp, time)

Parameters:
Name Type Description
cmp CmpTween
time number
Source:

(static) updateTween(cmp, time, resolvingStarts) → {bool}

Update a Tween. Modified from TWEEN.update.

Debug Notes: twn.onStart is called in XTweener.updateTween, later than startTween, but isPlaying is set in startTween. So there are chance such that twn.isPlaying = true but e.Obj3.mi is not initialized.

Shall we revise Tween.js?

Parameters:
Name Type Description
cmp CmpTween

tween component

time number
resolvingStarts object
Source:
Returns:

always true (compitibility with TWEEN.js?)

Type
bool

(static) validate(entity) → {bool}

Validating the entity can be animized

Parameters:
Name Type Description
entity ECS.Entity
Source:
Returns:

ok or not

Type
bool

initTweens(ecs, entites)

Parameters:
Name Type Description
ecs ECS
entites Set
Source:

update(tick, entities)

Parameters:
Name Type Description
tick int
entities array.<Entity>
Source: