The GeometricRenderer component draws hollow (stroke-only) 2D geometry: polygon outlines,
polylines, and circle outlines. It feeds the same path as debug collider drawing (RenderDataType.Geometric).

The entity must have a Transform. World position is Transform.localPosition plus offset (with the
same rotated-offset behavior as MaskRenderer). Transform.localScale scales vertexModel and,
for circles, scales radius by the larger of |scale.x| and |scale.y|.

Nothing is drawn if geometry is invalid: circumference requires radius > 0; polygon requires at least three
vertices; line mode requires at least two vertices and an even count.

const outline = new GeometricRenderer({
shape: GeometricShape.Polygon,
color: "#00FF88",
layer: "Default",
vertexModel: [
new Vector2(-16, -16),
new Vector2(16, -16),
new Vector2(16, 16),
new Vector2(-16, 16),
],
offset: new Vector2(0, 0),
rotation: 0,
});
const segments = new GeometricRenderer({
shape: GeometricShape.Line,
color: "#FFFFFF",
layer: "Default",
vertexModel: [new Vector2(0, 0), new Vector2(100, 0)],
offset: new Vector2(0, 0),
rotation: 0,
});
const ring = new GeometricRenderer({
shape: GeometricShape.Circumference,
color: "#FF6600",
layer: "Default",
radius: 32,
offset: new Vector2(0, 0),
rotation: 0,
});

Constructors

Properties

color: string = "#FFFFFF"

Stroke color (hex)

layer: string = defaultRenderLayer

Render layer

offset: Vector2 = ...

X/Y offset from the entity position

radius: number = 0

Radius in pixels for GeometricShape.Circumference

rotation: number = 0

Additional rotation in radians (added to the Transform)

shape: GeometricShape = GeometricShape.Polygon
vertexModel: Vector2[] = []

Local-space vertices for polygon or line mode