Skip to content

editor › Globals › NumberAnimation

Class: NumberAnimation

Hierarchy

↳ NumberAnimation

Index

Properties

Methods

Properties

Protected startValue

• startValue: number | null = null

Inherited from KyubAnimation.startValue

Defined in src/renderContext/animations/KyubAnimation.ts:13


Protected targetValue

• targetValue: number | null = null

Inherited from KyubAnimation.targetValue

Defined in src/renderContext/animations/KyubAnimation.ts:14

Methods

Protected _interpolate

▸ _interpolate(percentage: number): number

Overrides KyubAnimation._interpolate

Defined in src/renderContext/animations/NumberAnimation.ts:12

Parameters:

Name Type
percentage number

Returns: number


Protected _setStartValue

▸ _setStartValue(value: number): void

Overrides KyubAnimation._setStartValue

Defined in src/renderContext/animations/NumberAnimation.ts:4

Parameters:

Name Type
value number

Returns: void


Protected _setTargetValue

▸ _setTargetValue(value: number): void

Overrides KyubAnimation._setTargetValue

Defined in src/renderContext/animations/NumberAnimation.ts:8

Parameters:

Name Type
value number

Returns: void


animate

▸ animate(timeDelta: number): boolean

Inherited from KyubAnimation.animate

Defined in src/renderContext/animations/KyubAnimation.ts:96

Animates the value on the target

Parameters:

Name Type Description
timeDelta number Time that has passed since last animate call (in ms)

Returns: boolean


cancel

▸ cancel(): void

Inherited from KyubAnimation.cancel

Defined in src/renderContext/animations/KyubAnimation.ts:158

Finish this animation immediately so that it will not invoke its setter function anymore.

Returns: void


clone

▸ clone(): this

Inherited from KyubAnimation.clone

Defined in src/renderContext/animations/KyubAnimation.ts:169

Returns: this


delay

▸ delay(delay: number): this

Inherited from KyubAnimation.delay

Defined in src/renderContext/animations/KyubAnimation.ts:55

Sets the initial delay of the animation in ms (chainable)

Parameters:

Name Type
delay number

Returns: this


from

▸ from(value: number): this

Inherited from KyubAnimation.from

Defined in src/renderContext/animations/KyubAnimation.ts:31

Sets the start value (chainable)

Parameters:

Name Type
value number

Returns: this


getPromise

▸ getPromise(): Promise‹void›

Inherited from KyubAnimation.getPromise

Defined in src/renderContext/animations/KyubAnimation.ts:165

Returns: Promise‹void›

A promise that is resolved once the animation finishes


getter

▸ getter(getterFunction: function): this

Inherited from KyubAnimation.getter

Defined in src/renderContext/animations/KyubAnimation.ts:63

Sets the function used to retrieve the current value (chainable)

Parameters:

▪ getterFunction: function

▸ (): number

Returns: this


in

▸ in(duration: number): this

Inherited from KyubAnimation.in

Defined in src/renderContext/animations/KyubAnimation.ts:47

Sets the duration of the animation in ms (chainable)

Parameters:

Name Type
duration number

Returns: this


onStart

▸ onStart(onStartCallback: function): this

Inherited from KyubAnimation.onStart

Defined in src/renderContext/animations/KyubAnimation.ts:87

Sets a callback that is called, right before the animation starts running (chainable)

Parameters:

▪ onStartCallback: function

▸ (): void

Returns: this


reset

▸ reset(): this

Inherited from KyubAnimation.reset

Defined in src/renderContext/animations/KyubAnimation.ts:147

Resets the state of this animation to the state before it started running (chainable). You can then rerun this animation from the start.

Returns: this


setter

▸ setter(setterFunction: function): this

Inherited from KyubAnimation.setter

Defined in src/renderContext/animations/KyubAnimation.ts:71

Sets the function used to set the new (animated) value (chainable)

Parameters:

▪ setterFunction: function

▸ (value: number, percentage?: number): void

Parameters:

Name Type
value number
percentage? number

Returns: this


to

▸ to(value: number): this

Inherited from KyubAnimation.to

Defined in src/renderContext/animations/KyubAnimation.ts:39

Sets the target value (chainable)

Parameters:

Name Type
value number

Returns: this


usingInterpolation

▸ usingInterpolation(interpolationInstance: Interpolation): this

Inherited from KyubAnimation.usingInterpolation

Defined in src/renderContext/animations/KyubAnimation.ts:79

Sets the interpolation method (chainable)

Parameters:

Name Type
interpolationInstance Interpolation

Returns: this