Cyclic Writers
Such writers render repeatedly with or without some movement
Cyclic writers are dynamic writers that can be rendered individually by making a new class instance of a renderable class that implements the base cyclic writer class, CyclicWriter, and one of the typed cyclic writer classes that you can implement in your renderable class.
Such writers can either be animated or static, and can be rendered either by calling their individual Render() function one by one or by putting renderable classes to a container and calling that container's WriteContainer() function from the ContainerTools class.
Implementation
In cyclic writers, the implementation usually implements the base cyclic writer class and one of the following classes:
GraphicalCyclicWriter
This cyclic writer utilizes positioning and supports widths and heights for graphical terminal applications
SimpleCyclicWriter
This cyclic writer simply writes the rendered output to the console and is suitable for simple and scrolling terminal applications
Most of the renderables also support colors, in which you can set with UseColors and their appropriate properties.
Available cyclic writers
The following built-in cyclic writers are available:
Shapes
Shapes are one of the cyclic writers that are available. The following shapes are available:
Circle
Renders a full circle to the console
Arc
Renders an arc (pie, semicircle, ellipsis, etc.) to the console
Ellipsis
Renders a full ellipsis to the console
Parallelogram
Renders a parallelogram to the console
Rectangle
Renders a rectangle to the console
Square
Renders a square to the console
Trapezoid
Renders a trapezoid to the console
Triangle
Renders a triangle to the console
Line
Renders a line to the console
To learn more about geometric shapes, consult the page below:
Charts
Charts are one of the cyclic writers that are available. The following charts are available:
BreakdownChart
Renders a breakdown chart to the console
BarChart
Renders a bar chart to the console
StickChart
Renders a stick chart to the console
StemLeafChart
Renders a stem leaf chart to the console
LineChart
Renders a line chart to the console
LinesChart
Renders a chart of lines to the console
PieChart
Renders a pie chart to the console
WinsLosses
Renders a wins and losses chart to the console
To learn more about charts, consult the page below:
Text
Text renderers are one of the cyclic writers that are available. The following text renderers are available:
AlignedFigletText
Renders an aligned figlet text to the console
AlignedText
Renders an aligned text to the console
AnimatedText
Renders an animated text to the console
BoundedText
Renders a bounded text to the console
FigletText
Renders a figlet text to the console
PowerLine
Renders a PowerLine segment to the console
TextMarquee
Renders a text marquee to the console
Decoration
Renders a decoration to the console
SyntaxText
Renders a syntax highlighed text to the console
TextPath
Renders a decorated text path to the console
To learn more about text renderers, consult the page below:
Artistic
Artistic renderers are one of the cyclic writers that are available. The following artistic renderers are available:
Border
Renders a border to the console
Box
Renders a box to the console
BoxFrame
Renders a box with border to the console
Canvas
Renders a canvas to the console
AnimatedCanvas
Renders an animated canvas to the console
To learn more about artistic renderers, consult the page below:
Progress Bars
Progress bars are one of the cyclic writers that are available. The following progress bars are available:
ProgressBar
Renders a progress bar with text and percentage to the console
ProgressBarNoText
Renders a progress bar with percentage to the console
SimpleProgress
Renders a progress bar to the console
Slider
Renders a slider to the console
Spinner
Renders a spinner to the console
To learn more about progress bars, consult the page below:
Lists and Calendars
Lists and calendars are one of the cyclic writers that are available. The following lists and calendars are available:
Table
Renders a simple table to the console
Calendars
Renders a calendar table to the console
Listing
Renders a list of elements to the console
ListEntry
Renders a list element to the console
Selection
Renders an active selection element to the console
PassiveSelection
Renders a passive selection element to the console
To learn more about lists and calendars, consult the page below:
Miscellaneous
Miscellaneous renderers are one of the cyclic writers that are available. The following renderers are available:
Eraser
Erases part of the screen in the console
Keybindings
Renders a list of keybindings in one line to the console
KeyShortcut
Renders a key shortcut part in one line to the console
Emoji
Renders an emoji to the console
Kaomoji
Renders a Kaomoji to the console
NerdFonts
Renders a Nerd Fonts typeface to the console
To learn more about those renderers, consult the page below:
Renderables and Containers
While a single cyclic writer class instance represents a single writer, containers store a group of cyclic writer class instances.
Renderables
Each of the cyclic writers listed above are classes that can be created to a new variable. Those classes are called renderables.
A renderable can be rendered either to the string (for buffering using RenderRenderable()) or to the console (with no buffering using WriteRenderable()) in the RendererTools class, depending on the context.
Containers
When you create a group of renderables, they are called containers. They can be rendered or written directly to the console.
A container can be rendered either to the string (for buffering using RenderContainer()) or to the console (with no buffering using WriteContainer()) in the ContainerTools class, depending on the context.
You can define a container by creating a new instance of the Container class and adding some of the renderables that can be identified by their name.
In addition to that, you can manipulate with a renderable using the following functions:
SetRenderablePosition()
Sets the renderable position
SetRenderableSize()
Sets the renderable size
IsRegistered()
Checks to see if a renderable with this ID is registered or not
RemoveRenderable()
Removes a renderable with this ID
GetRenderable()
Gets a renderable instance from this ID
GetRenderablePosition()
Gets a renderable instance position from this ID
GetRenderableSize()
Gets a renderable instance size from this ID
GetRenderableNames()
Gets an array of renderable IDs
Some of the renderables may override the position variable for a renderable and may use the values from the renderables' properties.
You can, however, control this behavior by setting any of the ignoreSetPositions (ignores the renderable positions and sets them to 0,0) and ignoreSetSize (ignores the renderable sizes and sets them to the maximum console dimensions) arguments.
Customization
Some of the console writers allow customization, such as the bordered boxes or progress bars.
Borders
You can customize the borders for some of the console writers that support borders by editing properties found in the global settings of the borders, which can be found in the BorderSettings.GlobalSettings property.
You can pass your own instance of BorderSettings with your own customizations to the border and its properties to the supported writers and all the informational boxes.
The following writers support editing the border settings:
BorderColorBorderTextColorBoxFrameColorProgressBarColorProgressBarVerticalColorSliderColorSliderVerticalColor...and much more
Pre-defined borders can be accessed by calling one of the properties found in the PredefinedBorders class.
Padding and margins
For margins, in all cyclic writers that derive from the GraphicalCyclicWriter class, you can use the following properties:
Padding: Object padding to create blank space around the selected areas in cells.Margin: Object margin to reduce the width and the height based on the margin values.
All graphical cyclic writers use the SetMargin property to set the appropriate position and size in accordance to the two above property values.
Last updated