Difference between revisions of "love.physics.newRectangleShape"

(Noted that rectangle's are centered to x,y)
m
Line 1: Line 1:
Shorthand for creating rectanglar PolygonShapes. The '''center''' of the rectangle is located at x,y.
+
Shorthand for creating rectanglar [[PolygonShape]]s. The '''center''' of the rectangle is located at x,y.
  
 
== Function ==
 
== Function ==
Line 48: Line 48:
 
* [[Constructs::Shape]]
 
* [[Constructs::Shape]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Shorthand for creating rectangluar PolygonShapes.}}
+
{{#set:Description=Shorthand for creating rectangluar [[PolygonShape]]s.}}
 
{{#set:Since=000}}
 
{{#set:Since=000}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.physics.newRectangleShape}}
 
{{i18n|love.physics.newRectangleShape}}

Revision as of 18:02, 29 May 2013

Shorthand for creating rectanglar PolygonShapes. The center of the rectangle is located at x,y.

Function

Available since LÖVE 0.8.0
These variants are not supported in earlier versions.

Synopsis

shape = love.physics.newRectangleShape( width, height )

Arguments

number width
The width of the rectangle.
number height
The height of the rectangle.

Returns

PolygonShape shape
A new PolygonShape.

Function

Synopsis

shape = love.physics.newRectangleShape( x, y, width, height, angle )

Arguments

number x
The offset along the x-axis.
number y
The offset along the y-axis.
number width
The width of the rectangle.
number height
The height of the rectangle.
number angle (0)
The initial angle of the rectangle.

Returns

PolygonShape shape
A new PolygonShape.

Function

Removed in LÖVE 0.8.0
This variant is not supported in that and later versions.

Synopsis

s = love.physics.newRectangleShape( body, x, y, width, height, 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 width
The width of the rectangle.
number height
The height of the rectangle.
number angle (0)
The initial angle of the rectangle.

Returns

PolygonShape s
A new PolygonShape.

See Also


Other Languages