This allows you to draw artistic stuff into the console so that you can build your own interactive console applications easily.
Border
You can render a nice border to the console either without any text, just a title, a text, or box title and text. You can also customize the borders, such as drop shadows which we'll showcase in the BoxFrame renderable.
var artistic =newBorder(){ Left =2, Top =1, InteriorWidth =20, InteriorHeight =10,};TextWriterRaw.WriteRaw(artistic.Render());
You can use the border settings to change the color of the border and to determine whether to display the entire border or not using a set of properties. For example, if you don't want to render the right edge, you can set BorderRightFrameEnabled to false.
Box
You can render a box to the terminal easily.
Box frame
It's basically the same as a border, but without text support and without filling inside the box
Canvas
This is your sandbox for your awesome creations. This is done by coloring individual pixels with a color of your choice.
Animated canvases
You can make animated canvases using the AnimatedCanvas class. It allows you to define canvas frames that describe a group of arrays of cell properties. They are changed sequentially to form an animated canvas. The example below is taken from this file.
var artistic = new Border()
{
Left = 2,
Top = 1,
InteriorWidth = 20,
InteriorHeight = 10,
Title = "Border title",
};
TextWriterRaw.WriteRaw(artistic.Render());
var artistic = new Border()
{
Left = 2,
Top = 1,
InteriorWidth = 20,
InteriorHeight = 10,
Text = "Border text",
};
TextWriterRaw.WriteRaw(artistic.Render());
var artistic = new Border()
{
Left = 2,
Top = 1,
InteriorWidth = 20,
InteriorHeight = 10,
Title = "Border title",
Text = "Border text",
};
TextWriterRaw.WriteRaw(artistic.Render());
var artistic = new Box()
{
Left = 2,
Top = 1,
InteriorWidth = 20,
InteriorHeight = 10,
Color = ConsoleColors.Magenta3
};
TextWriterRaw.WriteRaw(artistic.Render());
var artistic = new BoxFrame("")
{
Left = 2,
Top = 1,
InteriorWidth = 20,
InteriorHeight = 10,
};
TextWriterRaw.WriteRaw(artistic.Render());
var artistic = new BoxFrame("Text")
{
Left = 2,
Top = 1,
InteriorWidth = 20,
InteriorHeight = 10,
};
TextWriterRaw.WriteRaw(artistic.Render());
var artistic = new BoxFrame("")
{
Left = 2,
Top = 1,
InteriorWidth = 20,
InteriorHeight = 10,
BackgroundColor = ConsoleColors.Aqua,
FrameColor = ConsoleColors.Black,
TitleColor = ConsoleColors.Black,
DropShadow = true,
ShadowColor = ConsoleColors.Teal,
};
TextWriterRaw.WriteRaw(artistic.Render());
var artistic = new BoxFrame("Hello world!")
{
Left = 2,
Top = 1,
InteriorWidth = 20,
InteriorHeight = 10,
BackgroundColor = ConsoleColors.Aqua,
FrameColor = ConsoleColors.Black,
TitleColor = ConsoleColors.Black,
DropShadow = true,
ShadowColor = ConsoleColors.Teal,
};
TextWriterRaw.WriteRaw(artistic.Render());
TextWriterColor.WriteColor("A simple box frame:", true, new Color(ConsoleColors.Green));
var frame1 = new BoxFrame()
{
Width = 20,
Height = 7,
Left = 2,
Top = 4,
};
var frame2 = new BoxFrame()
{
Width = 20,
Height = 7,
Left = 24,
Top = 4,
Rulers =
[
new(3, RulerOrientation.Horizontal),
]
};
var frame3 = new BoxFrame()
{
Width = 20,
Height = 7,
Left = 2,
Top = 13,
Rulers =
[
new(8, RulerOrientation.Vertical),
]
};
var frame4 = new BoxFrame()
{
Width = 20,
Height = 7,
Left = 24,
Top = 13,
Rulers =
[
new(3, RulerOrientation.Horizontal),
new(8, RulerOrientation.Vertical),
]
};
TextWriterRaw.WriteRaw(frame1.Render());
TextWriterRaw.WriteRaw(frame2.Render());
TextWriterRaw.WriteRaw(frame3.Render());
TextWriterRaw.WriteRaw(frame4.Render());