Skip to content

Quad ​

Solid-colour rectangles and lines.

ts
import { Quad } from "willow";

Quad ​

ts
class Quad extends Node

Extends Node.

Solid-colour quad (no texture). Useful for primitives and tests.

Quad: constructors ​

ts
new Quad(width: float, height: float)
new Quad(width: float, height: float, color: Color)

Quad: properties ​

MemberDescription
color: ColorEquivalent to quad.color = color. Solid fill colour, a Color.
height: floatQuad height in pixels (authored base size).
width: floatQuad width in pixels (authored base size).

Quad: methods ​

MemberDescription
setColor(color: Color): voidEquivalent to quad.color = color. Solid fill colour.

Quad: static methods ​

MemberDescription
static line(x1: float, y1: float, x2: float, y2: float, thickness: float, color: Color): QuadCreates a solid-colour line segment from (x1, y1) to (x2, y2) with the given thickness.