{{newin|[[0.3.2]]|032|type=function}}
Draws a rectangle.
== Function ==
=== Synopsis ===
<source lang="lua">
love.graphics.rectangle( mode, x, y, width, height )
</source>
=== Arguments ===
{{param|DrawMode|mode|How to draw the rectangle.}}
{{param|number|x|The position of top-left corner along the x-axis.}}
{{param|number|y|The position of top-left corner along the y-axis.}}
{{param|number|width|Width of the rectangle.}}
{{param|number|height|Height of the rectangle.}}

=== Returns ===
Nothing.

== Function ==
{{newin|[[0.10.0]]|100|type=variant}}
Draws a rectangle with rounded corners.
=== Synopsis ===
<source lang="lua">
love.graphics.rectangle( mode, x, y, width, height, rx, ry, segments )
</source>
=== Arguments ===
{{param|DrawMode|mode|How to draw the rectangle.}}
{{param|number|x|The position of top-left corner along the x-axis.}}
{{param|number|y|The position of top-left corner along the y-axis.}}
{{param|number|width|Width of the rectangle.}}
{{param|number|height|Height of the rectangle.}}
{{param|number|rx|The x-axis radius of each round corner. Cannot be greater than half the rectangle's width.}}
{{param|number|ry (rx)|The y-axis radius of each round corner. Cannot be greater than half the rectangle's height.}}
{{param|number|segments (nil)|The number of segments used for drawing the round corners. A default amount will be chosen if no number is given.}}
=== Returns ===
Nothing.

== Examples == 
=== Draws a rectangle at 20,50 with a width of 60 and a height of 120 ===
<source lang="lua">
function love.draw()
    love.graphics.rectangle("fill", 20, 50, 60, 120 )
end
</source>

== See Also ==
* [[parent::love.graphics]]
[[Category:Functions]]
[[Sub-Category::Drawing| ]]
{{#set:Description=Draws a rectangle.}}
== Other Languages ==
{{i18n|love.graphics.rectangle}}