|
a2FillTriangle
This command will draw a filled triangle on the screen.
a2FillTriangle x1, y1, x2, y2, x3, y3, color
a2FillTriangle x1, y1, x2, y2, x3, y3, color1, color2, color3
x1
Float
This value specifies the X coordinate of the first corner of the triangle.
y1
Float
This value specifies the Y coordinate of the first corner of the triangle.
x2
Float
This value specifies the X coordinate of the second corner of the triangle.
y2
Float
This value specifies the Y coordinate of the second corner of the triangle.
x3
Float
This value specifies the X coordinate of the third corner of the triangle.
y3
Float
This value specifies the Y coordinate of the third corner of the triangle.
color1
Integer
This value is a 32 bit integer specifying alpha, red, green, and blue color levels of the first corner of the triangle.
color2
Integer
This value is a 32 bit integer specifying alpha, red, green, and blue color levels of the second corner of the triangle.
color3
Integer
This value is a 32 bit integer specifying alpha, red, green, and blue color levels of the third corner of the triangle.
This command does not return a value.
The command requires three coordinate pairs and either one or three 32 bit color values. If only one color is specified, the triangle is drawn in that color. If three colors are specified, the color of the triangle is a gradient starting at the first corner, and continuing through the second and third corners.
x1 = screen width()/2
y1 = screen height()/3
x2 = screen width()/3
y2 = y1*2
x3 = x2*2
y3 = y2
a2FillTriangle x1, y1, x2, y2, x3, y3, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF
WAIT KEY
a2Triangle
Advanced 2D Index
Main Menu
|