Class: AnimationComponent
Defined in: animations/components/animation-component.ts:77
Represents an animation component that manages a collection of animations.
Extends
Constructors
Constructor
new AnimationComponent(
animations):AnimationComponent
Defined in: animations/components/animation-component.ts:100
Creates an instance of AnimationComponent.
Parameters
animations
An AnimatedProperty or array of AnimatedProperties to initialize the component with.
AnimatedProperty | AnimatedProperty[]
Returns
AnimationComponent
Example
const animation = new AnimationComponent({
duration: 1000,
updateCallback: (value) => console.log(value),
easing: (t) => t * t,
loop: 'loop',
loopCount: 3,
});
Overrides
Accessors
animations
Get Signature
get animations():
Required<AnimatedProperty>[]
Defined in: animations/components/animation-component.ts:84
Gets the list of animations managed by this component.
Returns
Required<AnimatedProperty>[]
An array of AnimatedProperty objects.
id
Get Signature
get
staticid():symbol
Defined in: ecs/types/Component.ts:12
The unique id of the component.
Returns
symbol
Inherited from
Methods
addAnimation()
addAnimation(
animation):void
Defined in: animations/components/animation-component.ts:114
Adds a new animation to the component.
Parameters
animation
The AnimatedProperty object to add.
Returns
void