ScanlinePolygonFill
Fills any polygon, concave or self-intersecting, as DrawRect bands: a scanline fill with an active-edge list. Spans in a band never overlap, so translucent fills blend once. Use it through Renderer.drawPolygonAsSpansTo()/drawConcavePolygonTo().
Constructor
new ScanlinePolygonFill(): ScanlinePolygonFillInstance Methods
fill(
canvasDrawTo: ifDraw2d,
points: Array.<BGE.Math.Vector>,
x: float,
y: float,
rgba: integer,
bandSize: integer,
bandAcrossY: dynamic,
fillRule: BGE.PolygonFillRule,
): integer
Fills points (any outline, in order) with one DrawRect per run of matching band spans. Each band's spans are the outline's cross-section at the band's middle, so at 1px it's accurate; edges come out stepped by up to bandSize pixels.
Parameters
canvasDrawTo(ifDraw2d)points(Array.<BGE.Math.Vector>) — the outline's corners in orderx(float) — offset added to every pointy(float) — offset added to every pointrgba(integer) — fill colorbandSize(integer) — band thickness in pixelsbandAcrossY(dynamic) — true for horizontal bands, false for vertical, invalid to band across the bounding box's shorter sidefillRule(BGE.PolygonFillRule)
Returns
integer— rects drawn