Text
Print some text here!
List of text renderers
1
Aligned figlet text
var text = new AlignedFigletText(FigletFonts.GetByName("small"), "Left")
{
Settings = new()
{
Alignment = TextAlignment.Left
}
};
var text2 = new AlignedFigletText(FigletFonts.GetByName("small"), "Middle")
{
Settings = new()
{
Alignment = TextAlignment.Middle
}
};
var text3 = new AlignedFigletText(FigletFonts.GetByName("small"), "Right")
{
Settings = new()
{
Alignment = TextAlignment.Right
}
};
TextWriterRaw.WriteRaw(text.Render());
TextWriterRaw.WriteRaw(text2.Render());
TextWriterRaw.WriteRaw(text3.Render());


2
Aligned text
var text = new AlignedText("Left")
{
Settings = new()
{
Alignment = TextAlignment.Left
}
};
var text2 = new AlignedText("Middle")
{
Settings = new()
{
Alignment = TextAlignment.Middle
}
};
var text3 = new AlignedText("Right")
{
Settings = new()
{
Alignment = TextAlignment.Right
}
};
TextWriterRaw.WriteRaw(text.Render());
TextWriterRaw.WriteRaw(text2.Render());
TextWriterRaw.WriteRaw(text3.Render());


3
Animated text
var animatedText = new AnimatedText()
{
TextFrames =
[
"H",
"He",
"Hel",
"Hell",
"Hello",
"Hello ",
"Hello W",
"Hello Wo",
"Hello Wor",
"Hello Worl",
"Hello World",
"Hello World!",
"Hello World!",
"Hello World!",
"Hello World!",
"Hello World!",
"Hello World!",
"Hello World!",
"Hello World!",
"Hello World!",
"Hello World!",
"Hello World!",
"Hello World!",
"Hello World!",
"Hello World ",
"Hello Worl ",
"Hello Wor ",
"Hello Wo ",
"Hello W ",
"Hello ",
"Hello ",
"Hell ",
"Hel ",
"He ",
"H ",
" ",
],
Left = 4,
Top = 2,
Width = 18,
};
for (int i = 0; i < animatedText.TextFrames.Length; i++)
{
TextWriterRaw.WriteRaw(animatedText.Render());
Thread.Sleep(100);
}
4
Bounded text
var text = new BoundedText("This is a bounded text that wraps. This is a bounded text that wraps. This is a bounded text that wraps. This is a bounded text that wraps. This is a bounded text that wraps. This is a bounded text that wraps. This is a bounded text that wraps.")
{
Settings = new()
{
Alignment = TextAlignment.Left
},
Width = 30,
Height = 5,
Line = 1,
};
var text2 = new BoundedText("This is a bounded text that wraps. This is a bounded text that wraps. This is a bounded text that wraps. This is a bounded text that wraps. This is a bounded text that wraps. This is a bounded text that wraps. This is a bounded text that wraps.")
{
Settings = new()
{
Alignment = TextAlignment.Left
},
Width = 30,
Height = 5,
Left = 40,
Line = 2,
};
TextWriterRaw.WriteRaw(text.Render());
TextWriterRaw.WriteRaw(text2.Render());

5
6
Text marquee
var stickScreen = new Screen()
{
CycleFrequency = 50,
};
var marquee = new TextMarquee(
"This is the test text marquee that's adjusted to your console width with the margin of 4 from both the " +
"left and the right side, and is intentionally long to make the text scroll just like how music players " +
"work.")
{
Width = ConsoleWrapper.WindowWidth - 8,
};
try
{
// First, clear the screen
ColorTools.LoadBack();
// Then, show the counter
var stickScreenPart = new ScreenPart();
stickScreenPart.Position(4, ConsoleWrapper.WindowHeight / 2);
stickScreenPart.AddDynamicText(marquee.Render);
stickScreen.AddBufferedPart("Test", stickScreenPart);
ScreenTools.SetCurrent(stickScreen);
ScreenTools.SetCurrentCyclic(stickScreen);
ScreenTools.StartCyclicScreen();
Input.ReadKey();
}
catch (Exception ex)
{
InfoBoxModalColor.WriteInfoBoxModal($"Screen failed to render: {ex.Message}");
}
finally
{
ScreenTools.StopCyclicScreen();
ScreenTools.UnsetCurrent(stickScreen);
ColorTools.LoadBack();
}
7
Decoration
var decoration1 = new Decoration()
{
ForegroundColor = ConsoleColors.Red,
Start = "..:: ",
End = " ::..",
};
var decoration2 = new Decoration()
{
ForegroundColor = ConsoleColors.Lime,
Start = "..::",
End = "::..",
};
var decoration3 = new Decoration()
{
ForegroundColor = ConsoleColors.Blue,
Start = "..::",
End = "::..",
};
TextWriterRaw.WritePlain("Full decoration: " + decoration1.Render());
TextWriterRaw.WritePlain("Start decoration: " + decoration2.RenderStart());
TextWriterRaw.WritePlain("End decoration: " + decoration3.RenderEnd() + "\n");
var alignedTextUndecorated = new AlignedText("Aligned text")
{
ForegroundColor = ConsoleColors.Yellow,
Top = 6,
LeftMargin = "Aligned text without decoration: ".Length,
};
var alignedTextDecorated = new AlignedText("Aligned text")
{
ForegroundColor = ConsoleColors.Yellow,
UseColors = true,
Top = 7,
LeftMargin = "Aligned text without decoration: ".Length,
Decoration = decoration2,
};
TextWriterRaw.WritePlain("Aligned text without decoration: " + alignedTextUndecorated.Render());
TextWriterRaw.WritePlain("Aligned text with decoration: " + alignedTextDecorated.Render());
8
9
Text path
var path1 = new TextPath()
{
PathText = @"C:\WINDOWS\System32\very\long\path\so\that\we\can\read-this.txt",
Left = 4,
Top = 2,
Width = 30,
};
var path2 = new TextPath()
{
PathText = @"C:\WINDOWS\System32\taskmgr.exe",
ForegroundColor = ConsoleColors.Green,
LastPathColor = ConsoleColors.Blue,
SeparatorColor = ConsoleColors.Yellow,
RootDriveColor = ConsoleColors.Red,
UseColors = true,
Settings = new() { Alignment = TextAlignment.Left },
Left = 4,
Top = 4,
Width = 40,
};
var path3 = new TextPath()
{
PathText = @"/etc/grub.d/40_custom",
ForegroundColor = ConsoleColors.Green,
LastPathColor = ConsoleColors.Blue,
SeparatorColor = ConsoleColors.Yellow,
RootDriveColor = ConsoleColors.Red,
UseColors = true,
Settings = new() { Alignment = TextAlignment.Middle },
Left = 4,
Top = 5,
Width = 40,
};
var path4 = new TextPath()
{
PathText = @"Source/Public/Terminaux",
ForegroundColor = ConsoleColors.Green,
LastPathColor = ConsoleColors.Blue,
SeparatorColor = ConsoleColors.Yellow,
RootDriveColor = ConsoleColors.Red,
UseColors = true,
Settings = new() { Alignment = TextAlignment.Right },
Left = 4,
Top = 6,
Width = 40,
};
TextWriterRaw.WriteRaw(path1.Render());
TextWriterRaw.WriteRaw(path2.Render());
TextWriterRaw.WriteRaw(path3.Render());
TextWriterRaw.WriteRaw(path4.Render());
Last updated

