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
bufferCharacterBufferpointsReadOnlySpan<(int X, int Y)>chcharfgColorbgColorclipRectLayoutRect?
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
bufferCharacterBufferx0inty0intx1inty1intx2inty2intchcharfgColorbgColorclipRectLayoutRect?
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
bufferCharacterBufferpointsReadOnlySpan<(int X, int Y)>chcharfgColorbgColorclipRectLayoutRect?
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)