Show / Hide Table of Contents

Class DrawString

Draws a string to a console as if someone was typing.

Inheritance
object
UpdateComponent
InstructionBase
DrawString
Implements
IComponent
Inherited Members
InstructionBase.Repeat()
InstructionBase.OnFinished(IScreenObject)
InstructionBase.OnRepeating()
InstructionBase.OnStarted()
InstructionBase.RemoveOnFinished
InstructionBase.IsFinished
InstructionBase.RepeatCount
InstructionBase.Started
InstructionBase.Finished
InstructionBase.Repeating
UpdateComponent.OnRemoved(IScreenObject)
UpdateComponent.SortOrder
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: SadConsole.Instructions
Assembly: SadConsole.dll
Syntax
public class DrawString : InstructionBase, IComponent

Constructors

DrawString()

Creates a new instance of the object. Text must be set manually.

Declaration
public DrawString()

DrawString(ColoredString)

Creates a new instance of the object with the specified text. Prints the text in one second.

Declaration
public DrawString(ColoredString text)
Parameters
Type Name Description
ColoredString text

DrawString(ColoredString, TimeSpan)

Creates a new instance of the object with the specified text.

Declaration
public DrawString(ColoredString text, TimeSpan duration)
Parameters
Type Name Description
ColoredString text

The text to print.

TimeSpan duration

The time to print the entire text.

Properties

Cursor

Represents the cursor used in printing. Use this for styling and printing behavior.

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

Position

Gets or sets the position on the console to write the text.

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

Text

Gets or sets the text to print.

Declaration
public ColoredString Text { get; set; }
Property Value
Type Description
ColoredString

TotalTimeToPrint

Gets or sets the total time to take to write the string. Use Zero for no duration.

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

Methods

OnAdded(IScreenObject)

Creates an invisible cursor that prints on the target surface.

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

The host this instruction is added to.

Overrides
UpdateComponent.OnAdded(IScreenObject)

Reset()

Resets the Done flag.

Declaration
public override void Reset()
Overrides
InstructionBase.Reset()
Remarks

On the base class, resets the IsFinished to false. Override this method to reset the derived class' counters and status flags for the instruction.

Update(IScreenObject, TimeSpan)

Executes the instruction. This base class method should be called from derived classes. If the IsFinished property is set to true, will try to repeat if needed and will raise all appropriate events.

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

The object that hosts this instruction.

TimeSpan delta

The time that has elapsed since this method was last called.

Overrides
InstructionBase.Update(IScreenObject, TimeSpan)

Implements

IComponent

Extension Methods

ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX