Skip to content
ConsoleMonster
Class

HalfBlockCanvas

ConsoleMonster.Canvas

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(int columns, int rows) #

Creates a half-block canvas.

Parameters

columns int required
Width in cells.
rows int required
Height in cells.

Methods

public override void Clear() #

Clears all pixels.

public override void Render(Region region, int x, int y, RenderContext context) #

Renders the canvas into a region at a local position.

Parameters

region ConsoleMonster.Canvas.Region required
The region.
x int required
Local column.
y int required
Local row.
context ConsoleMonster.Canvas.RenderContext required
The render context.
public override void Set(int x, int y, Color color) #

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

Parameters

x int required
Pixel column (0 = left).
y int required
Pixel row (0 = top).
color ConsoleMonster.Styling.Color required
The colour; a cell shows the colour of the last pixel set in it.