Difference between revisions of "love.physics.newRectangleShape"

m (1 revision: Importing from potato (again).)
m (Added note about anchor point.)
Line 1: Line 1:
 
 
Shorthand for creating rectangluar PolygonShapes.  
 
Shorthand for creating rectangluar PolygonShapes.  
 
The rectangle will be created at (x,y) in local coordinates.
 
The rectangle will be created at (x,y) in local coordinates.
Line 16: Line 15:
 
=== Returns ===
 
=== Returns ===
 
{{param|PolygonShape|s|A new PolygonShape.}}
 
{{param|PolygonShape|s|A new PolygonShape.}}
 +
=== Note ===
 +
love.physics.newRectangleShape() anchors from the center of the shape by default.
 
== See Also ==
 
== See Also ==
 
* [[parent::love.physics]]
 
* [[parent::love.physics]]

Revision as of 16:03, 27 February 2010

Shorthand for creating rectangluar PolygonShapes. The rectangle will be created at (x,y) in local coordinates.

Function

Synopsis

s = love.physics.newRectangleShape( body, x, y, w, h, angle )

Arguments

Body body
The Body to attach the Shape to.
number x
The offset along the x-axis.
number y
The offset along the y-axis.
number w
The width of the rectangle.
number h
The height of the rectangle.
number angle (0)
The initial angle of the rectangle.

Returns

PolygonShape s
A new PolygonShape.

Note

love.physics.newRectangleShape() anchors from the center of the shape by default.

See Also