Skip to content
ConsoleMonster

API Reference

Class

HalfBlockCanvas

Namespace ConsoleMonster.Canvas
Assembly ConsoleMonster
Modifiers sealed

A canvas with 1x2 pixels per cell drawn with half blocks (▀ ▄ █). Each pixel keeps its own colour: when the two pixels of a cell differ, the upper one is the foreground and the lower one the background. Basic-tier fonts (Consolas, Lucida Console) can show it; it is also the renderer for pixel-art logos.

Inheritance

Constructors

public HalfBlockCanvas(Int32 columns, Int32 rows) #

Creates a half-block canvas.

Parameters

columns System.Int32 requiredposition: 0
Width in cells.
rows System.Int32 requiredposition: 1
Height in cells.

Methods

public override Void Clear() #
Returns: Void

Clears all pixels.

public override Void Render(Region region, Int32 x, Int32 y, RenderContext context) #
Returns: Void

Renders the canvas into a region at a local position.

Parameters

region ConsoleMonster.Canvas.Region requiredposition: 0
The region.
x System.Int32 requiredposition: 1
Local column.
y System.Int32 requiredposition: 2
Local row.
context ConsoleMonster.Canvas.RenderContext requiredposition: 3
The render context.
public override Void Set(Int32 x, Int32 y, Color color) #
Returns: Void

Sets a pixel. Out-of-range pixels are ignored.

Parameters

x System.Int32 requiredposition: 0
Pixel column (0 = left).
y System.Int32 requiredposition: 1
Pixel row (0 = top).
color ConsoleMonster.Styling.Color requiredposition: 2
The colour; a cell shows the colour of the last pixel set in it.