getShapeBounds()
Purpose
Find the boundaries of a supplied shape
Description
Returns the boundaries (edges) of a shape drawn with drawShape()
Syntax
boundaries = getShapeBounds( shape )
Arguments
shape Handle which stores the shape in question
boundaries Vector describing the boundaries of the shape in { left, top, width, height } format.
Example
box_1 = createBox( gwidth() / 2, gheight() / 2, gwidth()/2, gheight()/2 )
setVertexColour(box_1, 0, bisque)
setVertexColour(box_1, 1, cyan)
setVertexColour(box_1, 2, fuzeblue)
setVertexColour(box_1, 3, fuzepink)
loop
clear()
j = controls(0)
moveShape(box_1, {j.lx, -j.ly}*10)
bounds = getShapeBounds(box_1)
print(bounds)
drawShape( box_1 )
update()
repeat
Associated Commands
copyShape(), createBox(), createCircle(), createCurve(), createLine(), createLineStrip(), createPoly(), createStar(), createTriangle(), deleteShape(), drawShape(), getShapeLocation(), getShapeRotation(), getShapeScale(), getShapeTint(), getVertex(), getVertexColour(), getVertexLineColour(), getVertexLineThickness(), joinShapes(), moveShape(), numVerts(), rotateShape(), scaleShape(), setShapeColour(), setShapeLineStyle(), setShapeRotation(), setShapeScale(), setShapeScaleModeLocal(), setShapeTint(), setVertex(), setVertexColour(), setVertexLineStyle()