a2Triangle

This command will draw an unfilled triangle on the screen.

  Syntax
a2Triangle x1, y1, x2, y2, x3, y3, color
a2Triangle x1, y1, x2, y2, x3, y3, color1, color2, color3
  Parameters
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.

  Returns

This command does not return a value.

  Description

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. The triangle is drawn with anti-aliasing by default.

  Example Code
x1 = screen width()/2
y1 = screen height()/3

x2 = screen width()/3
y2 = y1*2

x3 = x2*2
y3 = y2

a2Triangle x1, y1, x2, y2, x3, y3, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF

WAIT KEY
  See also

a2FillTriangle
Advanced 2D Index
Main Menu