createBox()
Purpose
Creates a box (rectangle) to be drawn with drawShape()
Description
Creates a box with centre origin to be drawn at the specified x and y location with the specified width and height
Syntax
shape = createBox( x, y, width, height )
Arguments
shape Handle which stores the newly created shape
x Horizontal screen position in pixels
y Vertical screen position in pixels
width Width in pixels
height Height in pixels
Example
// draw a multicoloured rectangle on the screen
box_1 = createBox( gwidth() / 2, gheight() / 2, gwidth(), gheight() )
setVertexColour( box_1, 0, bisque )
setVertexColour( box_1, 1, cyan )
setVertexColour( box_1, 2, fuzeblue )
setVertexColour( box_1, 3, fuzepink )
drawShape( box_1 )
update()
sleep( 3 )
Associated Commands
copyShape(), createCircle(), createCurve(), createLine(), createLineStrip(), createPoly(), createStar(), createTriangle(), deleteShape(), drawShape(), getShapeBounds(), getShapeLocation(), getShapeRotation(), getShapeScale(), getShapeTint(), getVertex(), getVertexColour(), getVertexLineColour(), getVertexLineThickness(), joinShapes(), moveShape(), numVerts(), rotateShape(), scaleShape(), setShapeColour(), setShapeLineStyle(), setShapeRotation(), setShapeScale(), setShapeScaleModeLocal(), setShapeTint(), setVertex(), setVertexColour(), setVertexLineStyle()