Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

triangle()

Purpose

Draw a triangle

Description

Draws a filled or outline triangle with vertices at the given points and in the specified colour.

Syntax

triangle( point1, point2, point3, colour, outline )

Arguments

point1 screen coordinates of first point in pixels

point2 screen coordinates of second point in pixels

point3 screen coordinates of second point in pixels

colour colour name or RGB values { red, green, blue, opacity } between 0 and 1

outline If true then only the outline is drawn otherwise the shape is filled.

Example

// Draw 100 random triangles
clear()
for i = 1 to 100 loop
    // Pick random colour
    col = { random( 101 ) / 100, random( 101 ) / 100, random( 101 ) / 100, random( 101 ) / 100 }
    point1 = { random( gWidth() ), random( gHeight() ) }
    point2 = { random( gWidth() ), random( gHeight() ) }
    point3 = { random( gWidth() ), random( gHeight() ) }
    outline = random( 2 )
    triangle( point1, point2, point3, col, outline )
    update()
repeat

for i = 1 to 100 loop
  update()
repeat

Associated Commands

box(), circle(), line()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.