Skip to main content

Interface: MotionConfig<T>

Tweening.MotionConfig

Interface for configuring motion animations in a Tween. You can specify easing, callback functions, and progress tracking functions.

Type parameters​

NameTypeDescription
TanyThe type of the target object being tweened.

Properties​

easing​

• Optional easing: Easing

The easing function to control the animation's progression.

Defined in​

src/tweening/Actions.ts:24


onComplete​

• Optional onComplete: (target: T) => void

Type declaration​

▸ (target): void

A callback function to execute when the animation completes.

Parameters​
NameTypeDescription
targetTThe target object that was tweened.
Returns​

void

Defined in​

src/tweening/Actions.ts:29


onProgress​

• Optional onProgress: (target: T, key: string, start: AllowedTypes, end: AllowedTypes, alpha: number) => boolean | void

Type declaration​

▸ (target, key, start, end, alpha): boolean | void

A callback function to be executed before each property is updated.

Parameters​
NameTypeDescription
targetTThe target object that is being tweened.
keystringThe key or property being animated.
startAllowedTypesThe initial value of the animated property.
endAllowedTypesThe final value of the animated property.
alphanumberThe current animation progress as a normalized value (0 to 1).
Returns​

boolean | void

If false, will not assign a new value to the property.

Defined in​

src/tweening/Actions.ts:49


onStart​

• Optional onStart: (target: T) => void

Type declaration​

▸ (target): void

A callback function to execute when the animation starts.

Parameters​
NameTypeDescription
targetTThe target object that is being tweened.
Returns​

void

Defined in​

src/tweening/Actions.ts:34


onUpdate​

• Optional onUpdate: (target: T) => void

Type declaration​

▸ (target): void

A callback function to be executed after each property has been updated.

Parameters​
NameTypeDescription
targetTThe target object that is being tweened.
Returns​

void

Defined in​

src/tweening/Actions.ts:39