API Reference › Screen — drawing › Screen.triangle
method

Screen.triangle

Screen.triangle(x1, y1, x2, y2, x3, y3, color)

Draws the outline of the triangle with corners (x1, y1), (x2, y2), (x3, y3) in color — three lines. Use it for arrows, wedges, and vector shapes.

Example

program Demo {
  handler DrawWorld phase Render {
    Screen.clear(Color.MidnightBlue)
    Screen.triangle(x1: 10, y1: 10, x2: 30, y2: 10, x3: 20, y3: 26, color: Color.White)
    Screen.show()
  }
}
← All symbols