API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classGraphicsPath
A reusable 2D path: a sequence of subpaths built from lines, Bézier curves and arcs, kept as commands rather than as vertices. ```ts const arrow = new GraphicsPath().moveTo(0, 0).lineTo(40, 20).lineTo(0, 40).closePath(); graphics.fillColor = Color.white; graphics.drawShape(arrow); ``` Keeping the commands is what separates this from a list of points: the same path flattens to as many vertices as the size it is drawn at needs, so one path can back an icon and a full-screen backdrop without either being over-tessellated or visibly faceted. Pass the tolerance you need to contours; the default suits drawing at roughly one path unit per pixel. A path is a value, not a scene node. It holds no GPU resources, needs no disposal, and can be shared between any number of Graphics instances and drawn any number of times. This is not the same thing as Graphics's own `moveTo`/`lineTo` cursor, which draws each segment the moment it is called and gives every segment its own mesh. A path is assembled first and drawn as one shape, so it can be filled, joined across segments, and kept for later.
import { GraphicsPath } from '@codexo/exojs'A reusable 2D path: a sequence of subpaths built from lines, Bézier curves and arcs, kept as commands rather than as vertices.
```ts const arrow = new GraphicsPath().moveTo(0, 0).lineTo(40, 20).lineTo(0, 40).closePath();
graphics.fillColor = Color.white; graphics.drawShape(arrow); ```
Keeping the commands is what separates this from a list of points: the same path flattens to as many vertices as the size it is drawn at needs, so one path can back an icon and a full-screen backdrop without either being over-tessellated or visibly faceted. Pass the tolerance you need to contours; the default suits drawing at roughly one path unit per pixel.
A path is a value, not a scene node. It holds no GPU resources, needs no disposal, and can be shared between any number of Graphics instances and drawn any number of times.
This is not the same thing as Graphics's own `moveTo`/`lineTo` cursor, which draws each segment the moment it is called and gives every segment its own mesh. A path is assembled first and drawn as one shape, so it can be filled, joined across segments, and kept for later.
new(): GraphicsPatharc(centerX: number, centerY: number, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean): thisarcTo(x1: number, y1: number, x2: number, y2: number, radius: number): thisbezierCurveTo(cpX1: number, cpY1: number, cpX2: number, cpY2: number, x: number, y: number): thiscircle(centerX: number, centerY: number, radius: number): thisclear(): thisclone(): GraphicsPathclosePath(): thiscontours(tolerance: number): readonly PathContourOne flattened subpath produced by GraphicsPath.contours.[]ellipse(centerX: number, centerY: number, radiusX: number, radiusY: number): thislineTo(x: number, y: number): thismoveTo(x: number, y: number): thisquadraticCurveTo(cpX: number, cpY: number, x: number, y: number): thisrect(x: number, y: number, width: number, height: number): thisroundedRect(x: number, y: number, width: number, height: number, radius: number): thiscurrentX: numbercurrentY: numberisEmpty: boolean