soggy.Documentation Back to Soggy ↗

renderer.triangle

Draws a filled triangle on the screen. The points need to be specified in clockwise order.

renderer.triangle(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, r: number, g: number, b: number, a: number)

Arguments

NameDescriptionType
x1Screen coordinate X for point Anumber
y1Screen coordinate Y for point Anumber
x2Screen coordinate X for point Bnumber
y2Screen coordinate Y for point Bnumber
x3Screen coordinate X for point Cnumber
y3Screen coordinate Y for point Cnumber
rRed color component (0 to 255)number
gGreen color component (0 to 255)number
bBlue color component (0 to 255)number
aAlpha (opacity) component (0 to 255)number

Type to search guides, functions and events.