Table of Contents

Interface IShapeBatchRenderer

Namespace
BSGameLib.Game.Rendering
Assembly
BSGameLib.Game.dll

Collects shapes for drawing with one shader and projection.

public interface IShapeBatchRenderer : IDisposable
Inherited Members

Methods

AddCircle(Vector2, float, Color, int, int, bool)

Adds a circle of radius, drawn with segments straight sides, filled, or as an outline thickness pixels wide.

void AddCircle(Vector2 center, float radius, Color color, int segments = 30, int thickness = 1, bool filled = false)

Parameters

center Vector2
radius float
color Color
segments int
thickness int
filled bool

AddColoredTriangles(ReadOnlySpan<Vector2>, ReadOnlySpan<Color>)

Adds raw triangles with a color per vertex. positions is taken three at a time; colors is parallel to it.

void AddColoredTriangles(ReadOnlySpan<Vector2> positions, ReadOnlySpan<Color> colors)

Parameters

positions ReadOnlySpan<Vector2>
colors ReadOnlySpan<Color>

AddLine(Vector2, Vector2, Color, int)

Adds a line from start to end, thickness pixels wide.

void AddLine(Vector2 start, Vector2 end, Color color, int thickness = 1)

Parameters

start Vector2
end Vector2
color Color
thickness int

AddPoint(Vector2, Color, int)

Adds a point at position, size pixels across.

void AddPoint(Vector2 position, Color color, int size = 1)

Parameters

position Vector2
color Color
size int

AddRectangle(Rectangle, Color, bool, int)

Adds rectangle, filled, or as an outline thickness pixels wide.

void AddRectangle(Rectangle rectangle, Color color, bool filled, int thickness = 1)

Parameters

rectangle Rectangle
color Color
filled bool
thickness int