Class
PixelCanvas
ConsoleMonster.Canvas
A sub-cell drawing surface: pixels are mapped onto cells using braille (2x4 per cell), half blocks (1x2 per cell) or plain characters (1x1 per cell). PixelCanvas.Create picks the densest canvas the glyph tier can show, so a chart drawn once looks right on every terminal.
Inheritance
- object
- PixelCanvas
Derived Types
Usage
Explore 1 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 1
- Method PixelCanvas.Create
Methods
public abstract void Clear() #Clears all pixels.
public static PixelCanvas Create(GlyphTier tier, int columns, int rows) #Creates the densest canvas a glyph tier can show.
Parameters
- tier ConsoleMonster.Capabilities.GlyphTier
- The glyph tier.
- columns int
- Width in cells.
- rows int
- Height in cells.
public void Line(int x0, int y0, int x1, int y1, Color color) #Draws a line between two pixels (Bresenham).
Parameters
- x0 int
- Start column.
- y0 int
- Start row.
- x1 int
- End column.
- y1 int
- End row.
- color ConsoleMonster.Styling.Color
- The colour.
public abstract 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
- The region.
- x int
- Local column.
- y int
- Local row.
- context ConsoleMonster.Canvas.RenderContext
- The render context.
public abstract void Set(int x, int y, Color color) #Sets a pixel. Out-of-range pixels are ignored.
Parameters
- x int
- Pixel column (0 = left).
- y int
- Pixel row (0 = top).
- color ConsoleMonster.Styling.Color
- The colour; a cell shows the colour of the last pixel set in it.
public void VerticalSpan(int x, int yTop, int yBottom, Color color) #Fills a vertical span of pixels in one column (bars, areas).
Parameters
- x int
- Pixel column.
- yTop int
- Top pixel row.
- yBottom int
- Bottom pixel row (inclusive).
- color ConsoleMonster.Styling.Color
- The colour.