setShapeRotation()
Purpose
Sets the rotation of a shape in degrees or radians
Description
Used to apply rotation to a shape drawn with drawShape()
Syntax
setShapeRotation( shape, amount )
Arguments
shape Handle which stores the shape to rotate
amount Float number of degrees (or radians) to rotate the shape by around the origin. Negative numbers apply counter-clockwise rotation
Example
gw = gWidth()
gh = gHeight()
shape = createBox( gw / 2, gh / 2, gw / 2, gh / 2 )
rotation = 0
loop
clear()
j = controls( 0 )
rotation += j.ly
setShapeRotation( shape, rotation )
drawShape( shape )
printAt( 0, 0, "Move left control stick up and down to rotate the shape." )
printAt( 0, 1, "Current rotation angle: ", rotation, " degrees" )
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(), setShapeScale(), setShapeScaleModeLocal(), setShapeTint(), setVertex(), setVertexColour(), setVertexLineStyle()