Skip to content

Documentation / @debuffjp/juice / Tweens

Class: Tweens ​

Defined in: tween.ts:39

Tweens numeric properties of any object. Drive with update(dt) from the game loop.

Constructors ​

Constructor ​

new Tweens(): Tweens

Returns ​

Tweens

Accessors ​

count ​

Get Signature ​

get count(): number

Defined in: tween.ts:96

Returns ​

number

Methods ​

has() ​

has(target, prop?): boolean

Defined in: tween.ts:92

True while a tween (or one on prop) is running or waiting on its delay for this target.

Parameters ​

target ​

object

prop? ​

string

Returns ​

boolean


kill() ​

kill(target, props?): void

Defined in: tween.ts:79

Cancel tweens on a target: all of them, or only the given properties, so other tweens on the same object keep running (squash a sprite without stopping its move).

Parameters ​

target ​

object

props? ​

readonly string[]

Returns ​

void


to() ​

to<T>(target, props, options): Tween

Defined in: tween.ts:42

Type Parameters ​

T ​

T extends object

Parameters ​

target ​

T

props ​

Partial<Pick<T, NumericKeys<T>>>

options ​

TweenOptions

Returns ​

Tween


update() ​

update(dt): void

Defined in: tween.ts:100

Parameters ​

dt ​

number

Returns ​

void