Graphics builds primitive shapes and renders them through the normal drawable flow.
- build filled and/or stroked shape geometry
- output
DrawableShapechildren internally - render on both WebGL2 and WebGPU through the built-in primitive path
fillColorlineColorlineWidth
import { Graphics, Color } from '@codexo/exojs';
const graphics = new Graphics();
graphics.fillColor = Color.white;
graphics.lineColor = Color.black;
graphics.lineWidth = 2;
graphics.drawRectangle(0, 0, 128, 128);
graphics.drawCircle(64, 64, 20);drawRectangle(...)drawCircle(...)drawEllipse(...)drawPolygon(...)drawLine(...)drawPath(...)
Graphicsis aContainer; each draw call adds internalDrawableShapechildren.- call
clear()to remove existing shapes and reset state. - for deterministic layering among siblings, use
zIndex+sortableChildrenon parent containers.