Table of Contents

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 string

The text of the title.

margin int

The margin of the title.

align TextAlignment

The alignment of the title.

font Font

The font of the title.

fontPath string

ATTENTION: 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

Font

Height

Gets the height of the title.

public override int Height { get; }

Property Value

int

Line

Gets the line of the title.

public override int Line { get; }

Property Value

int

MaxNumberOfThisElement

Gets the maximum number of this element.

public override int MaxNumberOfThisElement { get; }

Property Value

int

Placement

Gets the placement of the title.

public override Placement Placement { get; }

Property Value

Placement

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

TextStyler

Width

Gets the width of the title.

public override int Width { get; }

Property Value

int

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 TextAlignment

The 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 Font

The new font of the title.

fontPath string

ATTENTION: 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 int

The 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 string

The new text of the title.

Remarks

For more information, consider visiting the documentation available here.