1
1
Fork 0
mirror of https://github.com/boxgaming/qbjs.git synced 2024-05-12 08:00:12 +00:00
2 G2D.Triangle
boxgaming edited this page 2023-05-13 07:10:59 -05:00

Draws a triangle.

Syntax

G2D.Triangle x1&, y1&, x2&, y2&, x3&, y3& [, clr~&]

Parameters

  • The three sets of x and y parameters define the three points of the triangle to render.
  • The optional color~& parameter defines the color of the triangle. If not specified, the default color will be used.

Examples

Example1: Draw numerous triangles of random size at random locations.

Import GFX From "lib/graphics/2d.bas"

Randomize Timer
Dim i As Integer
For i = 1 To 500
    GFX.Triangle Rnd * 640, Rnd * 400, Rnd * 640, Rnd * 480, Rnd * 640, Rnd * 480, Rnd * 14 + 1
    _Limit 200
Next i

See Also

G2D.FillTriangle