setShapeColour()
Purpose
Applies a colour to a shape
Description
Used to apply a colour vector (RGBA) to a shape drawn with drawShape()
Syntax
setShapeColour( shape, colour )
Arguments
shape Handle which stores the shape in question
colour RGBA vector which describes the colour to be applied to the supplied shape
Example
gw = gWidth()
gh = gHeight()
shape = createBox( gw / 2, gh / 2, gw / 2, gh / 2 )
press = false
col = white
loop
clear()
j = controls( 0 )
if j.a and !press then
col = { random( 1.0 ), random( 1.0 ), random( 1.0 ), 1 }
setShapeColour( shape, col )
press = true
endif
if !j.a then
press = false
endif
drawShape( shape )
printAt( 0, 1, "Press the A button to change the shape colour!" )
printAt( 0, 3, "Current shape colour RGBA vector: ", col )
update()
repeat
Associated Commands
copyShape(), createBox(), 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(), setVertex(), setVertexColour(), setVertexLineStyle()