Class Title
- Namespace
- ConsoleAppVisuals.PassiveElements
- Assembly
- ConsoleAppVisuals.dll
The Title is a passive element that displays a title on the console.
public class Title : PassiveElement
- Inheritance
-
Title
- Inherited Members
Remarks
For more information, consider visiting the documentation available here.
Constructors
Title(string, int, TextAlignment, Font, string?)
The Title is a passive element that displays a title on the console.
public Title(string text, int margin = 1, TextAlignment align = TextAlignment.Center, Font font = Font.ANSI_Shadow, string? fontPath = null)
Parameters
text
stringThe text of the title.
margin
intThe margin of the title.
align
TextAlignmentThe alignment of the title.
font
FontThe font of the title.
fontPath
stringATTENTION: fill this parameter only if you want to use a custom font (Font.Custom).
Remarks
For more information, consider visiting the documentation available here.
Properties
Font
Gets the font of the title.
public Font Font { get; }
Property Value
Height
Gets the height of the title.
public override int Height { get; }
Property Value
Line
Gets the line of the title.
public override int Line { get; }
Property Value
MaxNumberOfThisElement
Gets the maximum number of this element.
public override int MaxNumberOfThisElement { get; }
Property Value
Placement
Gets the placement of the title.
public override Placement Placement { get; }
Property Value
StyledText
Gets the styled text of the title.
public string[] StyledText { get; }
Property Value
- string[]
Styler
Gets the text styler of the title.
public TextStyler Styler { get; }
Property Value
Width
Gets the width of the title.
public override int Width { get; }
Property Value
Methods
RenderElementActions()
Defines the actions to perform when the element is called to be rendered on the console.
[Visual]
protected override void RenderElementActions()
UpdateAlignment(TextAlignment)
Updates the alignment of the title.
public void UpdateAlignment(TextAlignment align)
Parameters
align
TextAlignmentThe new alignment of the title.
Remarks
For more information, consider visiting the documentation available here.
UpdateFont(Font, string?)
Updates the font of the title.
public void UpdateFont(Font font, string? fontPath = null)
Parameters
font
FontThe new font of the title.
fontPath
stringATTENTION: fill this parameter only if you want to use a custom font (Font.Custom).
Remarks
For more information, consider visiting the documentation available here.
UpdateMargin(int)
Updates the margin of the title.
public void UpdateMargin(int margin)
Parameters
margin
intThe new margin of the title.
Remarks
For more information, consider visiting the documentation available here.
Exceptions
- ArgumentOutOfRangeException
The margin must be between 0 and the half of the console height.
UpdateText(string)
Updates the text of the title.
public void UpdateText(string text)
Parameters
text
stringThe new text of the title.
Remarks
For more information, consider visiting the documentation available here.