Difference between revisions of "Shape:getBoundingBox"

m (Sorry, I just can't get the form to feel right)
(Counterclockwise -> clockwise (you lazy farts))
Line 7: Line 7:
 
x1, y1, x2, y2, x3, y3, x4, y4 = Shape:getBoundingBox( )
 
x1, y1, x2, y2, x3, y3, x4, y4 = Shape:getBoundingBox( )
 
</source>
 
</source>
Vertexes are returned starting in the top-left in a counterclockwise fashion (top-left, bottom-left, bottom-right, top-right).
+
Vertexes are returned starting in the top-left in a clockwise fashion (bottem-left, top-left, top-right, bottom-right).
  
 
=== Arguments ===
 
=== Arguments ===

Revision as of 19:50, 1 July 2010

Gets the bounding box of the shape. This function can be used in a nested fashion with love.graphics.polygon.

Function

Synopsis

A bounding box is the smallest rectangle that encapsulates the entire polygon.

x1, y1, x2, y2, x3, y3, x4, y4 = Shape:getBoundingBox( )

Vertexes are returned starting in the top-left in a clockwise fashion (bottem-left, top-left, top-right, bottom-right).

Arguments

None.

Returns

number x1
The x-component of the first vertex.
number y1
The y-component of the first vertex.
number x2
The x-component of the second vertex.
number y2
The y-component of the second vertex.
number x3
The x-component of the third vertex.
number y3
The y-component of the third vertex.
number x4
The x-component of the fourth vertex.
number y4
The y-component of the fourth vertex.

See Also