Interface GeometricRendererOptions

GeometricRenderer component configuration

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,
});
interface GeometricRendererOptions {
    color: string;
    layer: string;
    offset: Vector2;
    radius: number;
    rotation: number;
    shape: GeometricShape;
    vertexModel: Vector2[];
}

Properties

color: string

Stroke color as a hex string (e.g. #RRGGBB)

layer: string

Render layer name; must match a layer seen by the Camera

offset: Vector2

Offset from the entity position, scaled by the entity Transform's scale like other renderers

radius: number

Radius in pixels when shape is GeometricShape.Circumference

rotation: number

Extra rotation in radians, added to the entity Transform's rotation

Outline type: closed polygon, line segments, or circle

vertexModel: Vector2[]

Vertices in local space relative to the entity.
For GeometricShape.Polygon, at least three points; drawn as a closed LINE_LOOP.
For GeometricShape.Line, an even number of points (pairs) for GL_LINES.
Ignored when shape is GeometricShape.Circumference.