Skip to content

AnimatedAppearanceComponent Class

A component for Entity that animates the AppearanceSingle property.

C#
[DataContract]
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class AnimatedAppearanceComponent : UpdateComponent, IComponent

Inheritance objectUpdateComponent

Implements IComponent

C#
public AnimatedAppearanceComponent()

The frames of animation.

C#
public ColoredGlyphAndEffect[] Frames { get; set; }

The total time it takes to play all Frames.

C#
public TimeSpan AnimationTime { get; set; }

When true, the animation will automatically restart after the last frame is applied. Otherwise, false and the animation stops when completed.

C#
public bool IsRepeatable { get; set; }

Called by the component system when this component is added to an object. Must be of type Entity.

C#
public override void OnAdded(IScreenObject host)

host IScreenObject
The component host.

InvalidCastException
This component was added to a type other than Entity.

Called by the component system when this component is removed from an object.

C#
public override void OnRemoved(IScreenObject host)

host IScreenObject
The component host.

Updates the animation frame index and applies the animation to the entity.

C#
public override void Update(IScreenObject host, TimeSpan delta)

host IScreenObject
The component host.

delta TimeSpan
The time between calls to this method.

Starts the animation and immediately applies the current frame to the entity.

C#
public void Start()

InvalidOperationException
The animation was started but there aren’t any frames to animate.

Stops the animation.

C#
public void Stop()

Restarts the animation at the first frame.

C#
public void Restart()