Table of Contents

Class BufferPolygonExtensions

Namespace
SharpConsoleUI.Drawing
Assembly
SharpConsoleUI.dll

Extension methods for polygon drawing on CharacterBuffer.

public static class BufferPolygonExtensions
Inheritance
BufferPolygonExtensions
Inherited Members

Methods

DrawPolygon(CharacterBuffer, ReadOnlySpan<(int X, int Y)>, char, Color, Color, LayoutRect?)

Draws a polygon outline by connecting consecutive points with lines.

public static void DrawPolygon(this CharacterBuffer buffer, ReadOnlySpan<(int X, int Y)> points, char ch, Color fg, Color bg, LayoutRect? clipRect = null)

Parameters

buffer CharacterBuffer
points ReadOnlySpan<(int X, int Y)>
ch char
fg Color
bg Color
clipRect LayoutRect?

DrawTriangle(CharacterBuffer, int, int, int, int, int, int, char, Color, Color, LayoutRect?)

Draws a triangle outline by connecting three vertices with lines.

public static void DrawTriangle(this CharacterBuffer buffer, int x0, int y0, int x1, int y1, int x2, int y2, char ch, Color fg, Color bg, LayoutRect? clipRect = null)

Parameters

buffer CharacterBuffer
x0 int
y0 int
x1 int
y1 int
x2 int
y2 int
ch char
fg Color
bg Color
clipRect LayoutRect?

FillPolygon(CharacterBuffer, ReadOnlySpan<(int X, int Y)>, char, Color, Color, LayoutRect?)

Draws a filled polygon using scanline rasterization with the even-odd rule.

public static void FillPolygon(this CharacterBuffer buffer, ReadOnlySpan<(int X, int Y)> points, char ch, Color fg, Color bg, LayoutRect? clipRect = null)

Parameters

buffer CharacterBuffer
points ReadOnlySpan<(int X, int Y)>
ch char
fg Color
bg Color
clipRect LayoutRect?

FillTriangle(CharacterBuffer, int, int, int, int, int, int, char, Color, Color, LayoutRect?)

Draws a filled triangle using scanline rasterization. Vertices are sorted by Y, then edges are interpolated per scanline.

public static void FillTriangle(this CharacterBuffer buffer, int x0, int y0, int x1, int y1, int x2, int y2, char ch, Color fg, Color bg, LayoutRect? clipRect = null)

Parameters

buffer CharacterBuffer
x0 int
y0 int
x1 int
y1 int
x2 int
y2 int
ch char
fg Color
bg Color
clipRect LayoutRect?