Class CanvasBuilder
- Namespace
- RatatuiUnity
Fluent builder for canvas widgets: world map, geometric shapes, text, and point clouds.
public sealed class CanvasBuilder
- Inheritance
-
CanvasBuilder
- Inherited Members
Examples
term.BeginCanvas(area, -180, 180, -90, 90, Marker.Braille)
.Map(MapResolution.High)
.Layer()
.Points(serverCoords, Color.yellow)
.Render();
Methods
Circle(double, double, double, Color)
Draw a circle outline.
public CanvasBuilder Circle(double x, double y, double radius, Color color)
Parameters
Returns
Layer()
Flush the current drawing layer so subsequent shapes render on top of previously drawn shapes.
public CanvasBuilder Layer()
Returns
Line(double, double, double, double, Color)
Draw a line segment.
public CanvasBuilder Line(double x1, double y1, double x2, double y2, Color color)
Parameters
Returns
Map(MapResolution)
Draw the world map.
public CanvasBuilder Map(MapResolution resolution = MapResolution.High)
Parameters
resolutionMapResolution
Returns
Points(double[], Color)
Draw a scatter of points. coords is interleaved
(x, y) doubles: [x0, y0, x1, y1, ...].
public CanvasBuilder Points(double[] coords, Color color)
Parameters
coordsdouble[]colorColor
Returns
Rectangle(double, double, double, double, Color)
Draw a rectangle outline.
public CanvasBuilder Rectangle(double x, double y, double width, double height, Color color)
Parameters
Returns
Render()
Finalize and enqueue the canvas widget command. Must be called exactly once; the builder is unusable afterward.
public void Render()
Text(double, double, string, Color)
Print a text label at the given canvas coordinates.
public CanvasBuilder Text(double x, double y, string text, Color color)