Difference between revisions of "love.physics.newRectangleShape"
m |
(Tag: Undo) |
||
(17 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
− | Shorthand for creating | + | Shorthand for creating rectangular [[PolygonShape]]s. |
− | + | ||
+ | By default, the local origin is located at the '''center''' of the rectangle as opposed to the top left for graphics. | ||
+ | |||
== Function == | == Function == | ||
+ | {{newin|[[0.8.0]]|080|type=variants|plural=yes}} | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | s = love.physics.newRectangleShape( body, x, y, | + | shape = love.physics.newRectangleShape( width, height ) |
+ | </source> | ||
+ | === Arguments === | ||
+ | {{param|number|width|The width of the rectangle.}} | ||
+ | {{param|number|height|The height of the rectangle.}} | ||
+ | === Returns === | ||
+ | {{param|PolygonShape|shape|A new PolygonShape.}} | ||
+ | |||
+ | == Function == | ||
+ | === Synopsis === | ||
+ | <source lang="lua"> | ||
+ | shape = love.physics.newRectangleShape( x, y, width, height, angle ) | ||
+ | </source> | ||
+ | |||
+ | === Arguments === | ||
+ | {{param|number|x|The offset along the x-axis.}} | ||
+ | {{param|number|y|The offset along the y-axis.}} | ||
+ | {{param|number|width|The width of the rectangle.}} | ||
+ | {{param|number|height|The height of the rectangle.}} | ||
+ | {{param|number|angle (0)|The initial angle of the rectangle.}} | ||
+ | === Returns === | ||
+ | {{param|PolygonShape|shape|A new PolygonShape.}} | ||
+ | |||
+ | == Function == | ||
+ | {{oldin|[[0.8.0]]|080|type=variant}} | ||
+ | === Synopsis === | ||
+ | <source lang="lua"> | ||
+ | s = love.physics.newRectangleShape( body, x, y, width, height, angle ) | ||
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
Line 10: | Line 40: | ||
{{param|number|x|The offset along the x-axis.}} | {{param|number|x|The offset along the x-axis.}} | ||
{{param|number|y|The offset along the y-axis.}} | {{param|number|y|The offset along the y-axis.}} | ||
− | {{param|number| | + | {{param|number|width|The width of the rectangle.}} |
− | {{param|number| | + | {{param|number|height|The height of the rectangle.}} |
{{param|number|angle (0)|The initial angle of the rectangle.}} | {{param|number|angle (0)|The initial angle of the rectangle.}} | ||
=== Returns === | === Returns === | ||
{{param|PolygonShape|s|A new PolygonShape.}} | {{param|PolygonShape|s|A new PolygonShape.}} | ||
− | + | ||
− | |||
== See Also == | == See Also == | ||
* [[parent::love.physics]] | * [[parent::love.physics]] | ||
+ | * [[Constructs::PolygonShape]] | ||
+ | * [[Constructs::Shape]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | {{#set:Description=Shorthand for creating | + | {{#set:Description=Shorthand for creating rectangular [[PolygonShape]]s.}} |
− | }} | + | {{#set:Since=000}} |
== Other Languages == | == Other Languages == | ||
{{i18n|love.physics.newRectangleShape}} | {{i18n|love.physics.newRectangleShape}} |
Latest revision as of 20:09, 5 July 2024
Shorthand for creating rectangular PolygonShapes.
By default, the local origin is located at the center of the rectangle as opposed to the top left for graphics.
Contents
Function
Available since LÖVE 0.8.0 |
These variants are not supported in earlier versions. |
Synopsis
shape = love.physics.newRectangleShape( width, height )
Arguments
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
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info