Show / Hide Table of Contents

Class SmoothMove

Animates the movement of an object.

Inheritance
object
UpdateComponent
SmoothMove
Implements
IComponent
Inherited Members
UpdateComponent.SortOrder
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: SadConsole.Components
Assembly: SadConsole.Extended.dll
Syntax
public class SmoothMove : UpdateComponent, IComponent

Constructors

SmoothMove()

Creates a new instance of this object with a default transition time of 200 milliseconds.

Declaration
public SmoothMove()

SmoothMove(Point)

Creates a new instance of this object with a fixed size for calculating smooth movement.

Declaration
public SmoothMove(Point fontSize)
Parameters
Type Name Description
Point fontSize

The size of the font used to display the object hosting the component.

SmoothMove(Point, TimeSpan)

Creates a new instance of this object with a fixed size for calculating smooth movement and the specified transition time.

Declaration
public SmoothMove(Point fontSize, TimeSpan transitionTime)
Parameters
Type Name Description
Point fontSize

The size of the font used to display the object hosting the component.

TimeSpan transitionTime

The amount of time it takes to animate the movement.

SmoothMove(TimeSpan)

Creates a new instance of this object with a specific transition time.

Declaration
public SmoothMove(TimeSpan transitionTime)
Parameters
Type Name Description
TimeSpan transitionTime

The amount of time it takes to animate the movement.

Properties

FontSize

The size of the parent object's font.

Declaration
public Point FontSize { get; set; }
Property Value
Type Description
Point

IsEnabled

false to pause this component and prevent it from animating movement; otherwise true to enable animating movement.

Declaration
public bool IsEnabled { get; set; }
Property Value
Type Description
bool

IsMoving

true when this component currently is animating the movement of the host object; otherwise false.

Declaration
public bool IsMoving { get; }
Property Value
Type Description
bool

TransitionEasingFunction

The easing function applied to smoothing the objects movement.

Declaration
public EasingBase? TransitionEasingFunction { get; set; }
Property Value
Type Description
EasingBase

TransitionTime

The amount of time it takes to animated the movement.

Declaration
public TimeSpan TransitionTime { get; set; }
Property Value
Type Description
TimeSpan

Methods

OnAdded(IScreenObject)

Called by the host when the component is added to an object. Add to a IScreenSurface or Entity.

Declaration
public override void OnAdded(IScreenObject host)
Parameters
Type Name Description
IScreenObject host

The IScreenSurface or Entity.

Overrides
UpdateComponent.OnAdded(IScreenObject)

OnRemoved(IScreenObject)

Called when the component is removed from the host.

Declaration
public override void OnRemoved(IScreenObject host)
Parameters
Type Name Description
IScreenObject host

The host that removed the component.

Overrides
UpdateComponent.OnRemoved(IScreenObject)

Update(IScreenObject, TimeSpan)

Updates the component. If the object is moving, changes to pixel positioning (if required) and animates the movement.

Declaration
public override void Update(IScreenObject host, TimeSpan delta)
Parameters
Type Name Description
IScreenObject host

The host object being moved.

TimeSpan delta

The time difference from the previous frame.

Overrides
UpdateComponent.Update(IScreenObject, TimeSpan)

Events

MoveEnded

Raised when the smoothing component ends moving an object.

Declaration
public event EventHandler? MoveEnded
Event Type
Type Description
EventHandler

MoveStarted

Raised when the smoothing component starts moving an object.

Declaration
public event EventHandler? MoveStarted
Event Type
Type Description
EventHandler

Implements

IComponent

Extension Methods

ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX