AnimatedAppearanceComponent Class
Definition
Section titled “Definition”A component for Entity that animates the AppearanceSingle property.
[DataContract][JsonObject(MemberSerialization = MemberSerialization.OptIn)]public class AnimatedAppearanceComponent : UpdateComponent, IComponentInheritance object → UpdateComponent
Implements IComponent
Constructors
Section titled “Constructors”AnimatedAppearanceComponent()
Section titled “AnimatedAppearanceComponent()”public AnimatedAppearanceComponent()Properties
Section titled “Properties”Frames
Section titled “Frames”The frames of animation.
public ColoredGlyphAndEffect[] Frames { get; set; }AnimationTime
Section titled “AnimationTime”The total time it takes to play all Frames.
public TimeSpan AnimationTime { get; set; }IsRepeatable
Section titled “IsRepeatable”When true, the animation will automatically restart after the last frame is applied. Otherwise, false and the animation stops when completed.
public bool IsRepeatable { get; set; }Methods
Section titled “Methods”OnAdded(IScreenObject)
Section titled “OnAdded(IScreenObject)”Called by the component system when this component is added to an object. Must be of type Entity.
public override void OnAdded(IScreenObject host)Parameters
Section titled “Parameters”host IScreenObject
The component host.
Exceptions
Section titled “Exceptions”InvalidCastException
This component was added to a type other than Entity.
OnRemoved(IScreenObject)
Section titled “OnRemoved(IScreenObject)”Called by the component system when this component is removed from an object.
public override void OnRemoved(IScreenObject host)Parameters
Section titled “Parameters”host IScreenObject
The component host.
Update(IScreenObject, TimeSpan)
Section titled “Update(IScreenObject, TimeSpan)”Updates the animation frame index and applies the animation to the entity.
public override void Update(IScreenObject host, TimeSpan delta)Parameters
Section titled “Parameters”host IScreenObject
The component host.
delta TimeSpan
The time between calls to this method.
Start()
Section titled “Start()”Starts the animation and immediately applies the current frame to the entity.
public void Start()Exceptions
Section titled “Exceptions”InvalidOperationException
The animation was started but there aren’t any frames to animate.
Stop()
Section titled “Stop()”Stops the animation.
public void Stop()Restart()
Section titled “Restart()”Restarts the animation at the first frame.
public void Restart()