DrawString Class
Definition
Section titled “Definition”Draws a string to a console as if someone was typing.
public class DrawString : InstructionBase, IComponentInheritance object → UpdateComponent → InstructionBase
Implements IComponent
Constructors
Section titled “Constructors”DrawString(ColoredString, TimeSpan)
Section titled “DrawString(ColoredString, TimeSpan)”Creates a new instance of the object with the specified text.
public DrawString(ColoredString text, TimeSpan duration)Parameters
Section titled “Parameters”text ColoredString
The text to print.
duration TimeSpan
The time to print the entire text.
DrawString(ColoredString)
Section titled “DrawString(ColoredString)”Creates a new instance of the object with the specified text. Prints the text in one second.
public DrawString(ColoredString text)Parameters
Section titled “Parameters”text ColoredString
DrawString()
Section titled “DrawString()”Creates a new instance of the object. Text must be set manually.
public DrawString()Properties
Section titled “Properties”Gets or sets the text to print.
public ColoredString Text { get; set; }TotalTimeToPrint
Section titled “TotalTimeToPrint”Gets or sets the total time to take to write the string. Use Zero for no duration.
public TimeSpan TotalTimeToPrint { get; set; }Position
Section titled “Position”Gets or sets the position on the console to write the text.
public Point Position { get; set; }Cursor
Section titled “Cursor”Represents the cursor used in printing. Use this for styling and printing behavior.
public Cursor? Cursor { get; set; }Methods
Section titled “Methods”Update(IScreenObject, TimeSpan)
Section titled “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.
public override void Update(IScreenObject componentHost, TimeSpan delta)Parameters
Section titled “Parameters”componentHost IScreenObject
The object that hosts this instruction.
delta TimeSpan
The time that has elapsed since this method was last called.
Reset()
Section titled “Reset()”Resets the Done flag.
public override void Reset()Remarks
Section titled “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.
OnAdded(IScreenObject)
Section titled “OnAdded(IScreenObject)”Creates an invisible cursor that prints on the target surface.
public override void OnAdded(IScreenObject host)Parameters
Section titled “Parameters”host IScreenObject
The host this instruction is added to.