SmoothMove Class
Definition
Section titled “Definition”Animates the movement of an object.
public class SmoothMove : UpdateComponent, IComponentInheritance object → UpdateComponent
Implements IComponent
Constructors
Section titled “Constructors”SmoothMove()
Section titled “SmoothMove()”Creates a new instance of this object with a default transition time of 200 milliseconds.
public SmoothMove()SmoothMove(Point)
Section titled “SmoothMove(Point)”Creates a new instance of this object with a fixed size for calculating smooth movement.
public SmoothMove(Point fontSize)Parameters
Section titled “Parameters”fontSize SadRogue.Primitives.Point
The size of the font used to display the object hosting the component.
SmoothMove(TimeSpan)
Section titled “SmoothMove(TimeSpan)”Creates a new instance of this object with a specific transition time.
public SmoothMove(TimeSpan transitionTime)Parameters
Section titled “Parameters”transitionTime TimeSpan
The amount of time it takes to animate the movement.
SmoothMove(Point, TimeSpan)
Section titled “SmoothMove(Point, TimeSpan)”Creates a new instance of this object with a fixed size for calculating smooth movement and the specified transition time.
public SmoothMove(Point fontSize, TimeSpan transitionTime)Parameters
Section titled “Parameters”fontSize SadRogue.Primitives.Point
The size of the font used to display the object hosting the component.
transitionTime TimeSpan
The amount of time it takes to animate the movement.
Properties
Section titled “Properties”IsMoving
Section titled “IsMoving”true when this component currently is animating the movement of the host object; otherwise false.
public bool IsMoving { get; }FontSize
Section titled “FontSize”The size of the parent object’s font.
public Point FontSize { get; set; }IsEnabled
Section titled “IsEnabled”false to pause this component and prevent it from animating movement; otherwise true to enable animating movement.
public bool IsEnabled { get; set; }TransitionEasingFunction
Section titled “TransitionEasingFunction”The easing function applied to smoothing the objects movement.
public EasingBase? TransitionEasingFunction { get; set; }TransitionTime
Section titled “TransitionTime”The amount of time it takes to animated the movement.
public TimeSpan TransitionTime { get; set; }Methods
Section titled “Methods”OnAdded(IScreenObject)
Section titled “OnAdded(IScreenObject)”Called by the host when the component is added to an object. Add to a IScreenSurface or Entity.
public override void OnAdded(IScreenObject host)Parameters
Section titled “Parameters”host IScreenObject
The IScreenSurface or Entity.
OnRemoved(IScreenObject)
Section titled “OnRemoved(IScreenObject)”Called when the component is removed from the host.
public override void OnRemoved(IScreenObject host)Parameters
Section titled “Parameters”host IScreenObject
The host that removed the component.
Update(IScreenObject, TimeSpan)
Section titled “Update(IScreenObject, TimeSpan)”Updates the component. If the object is moving, changes to pixel positioning (if required) and animates the movement.
public override void Update(IScreenObject host, TimeSpan delta)Parameters
Section titled “Parameters”host IScreenObject
The host object being moved.
delta TimeSpan
The time difference from the previous frame.
Events
Section titled “Events”MoveStarted
Section titled “MoveStarted”Raised when the smoothing component starts moving an object.
public event EventHandler? MoveStartedEvent Type
Section titled “Event Type”MoveEnded
Section titled “MoveEnded”Raised when the smoothing component ends moving an object.
public event EventHandler? MoveEnded