API Reference
Class
PixelCanvas
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
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 static PixelCanvas Create(GlyphTier tier, Int32 columns, Int32 rows) #Returns:
PixelCanvasCreates the densest canvas a glyph tier can show.
Parameters
- tier ConsoleMonster.Capabilities.GlyphTier
- The glyph tier.
- columns System.Int32
- Width in cells.
- rows System.Int32
- Height in cells.
Returns
A braille canvas (Full), half-block canvas (Basic) or character canvas (Ascii).
public Void Line(Int32 x0, Int32 y0, Int32 x1, Int32 y1, Color color) #Returns:
VoidDraws a line between two pixels (Bresenham).
Parameters
- x0 System.Int32
- Start column.
- y0 System.Int32
- Start row.
- x1 System.Int32
- End column.
- y1 System.Int32
- End row.
- color ConsoleMonster.Styling.Color
- The colour.
public abstract Void Render(Region region, Int32 x, Int32 y, RenderContext context) #Returns:
VoidRenders the canvas into a region at a local position.
Parameters
- region ConsoleMonster.Canvas.Region
- The region.
- x System.Int32
- Local column.
- y System.Int32
- Local row.
- context ConsoleMonster.Canvas.RenderContext
- The render context.
public abstract Void Set(Int32 x, Int32 y, Color color) #Returns:
VoidSets a pixel. Out-of-range pixels are ignored.
Parameters
- x System.Int32
- Pixel column (0 = left).
- y System.Int32
- 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(Int32 x, Int32 yTop, Int32 yBottom, Color color) #Returns:
VoidFills a vertical span of pixels in one column (bars, areas).
Parameters
- x System.Int32
- Pixel column.
- yTop System.Int32
- Top pixel row.
- yBottom System.Int32
- Bottom pixel row (inclusive).
- color ConsoleMonster.Styling.Color
- The colour.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?