Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

box()

Purpose

Draw a box (rectangle)

Description

Draws a filled or outline box with the given width and height at the specified x and y coordinates in the specified colour.

Syntax

box( x, y, width, height, colour, outline )

Arguments

x horizontal screen position in pixels

y vertical screen position in pixels

width width in pixels

height height 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 boxes
clear()
for i = 0 to 100 loop
    // Pick random colour
    col = { random( 101 ) / 100, random( 101 ) / 100, random( 101 ) / 100, random( 101 ) / 100 }
    x = random( gWidth() )
    y = random( gHeight() )
    width = random( gWidth() / 4 )
    height = random( gHeight() / 4 )
    outline = random( 2 )
    box( x, y, width, height, col, outline )
    update()
repeat
// Wait 3 seconds
sleep( 3 )

Associated Commands

circle(), line(), triangle()

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.