Difference between revisions of "love.graphics.rectangle"

m
(Explained an example)
Line 15: Line 15:
  
 
== Examples ==  
 
== Examples ==  
 +
=== Draws a rectangle at 20,50 with a width of 60 and a height of 120 ===
 
<source lang="lua">
 
<source lang="lua">
  love.graphics.rectangle("fill", 50, 50, 60, 120 )
+
  love.graphics.rectangle("fill", 20, 50, 60, 120 )
 
</source>
 
</source>
  

Revision as of 05:47, 15 June 2013

Draws a rectangle.

Function

Synopsis

love.graphics.rectangle( mode, x, y, width, height )

Arguments

DrawMode mode
How to draw the rectangle.
number x
The position of top-left corner along x-axis.
number y
The position of top-left corner along y-axis.
number width
Width of the rectangle.
number height
Height of the rectangle.

Returns

Nothing.

Examples

Draws a rectangle at 20,50 with a width of 60 and a height of 120

 love.graphics.rectangle("fill", 20, 50, 60, 120 )

See Also


Other Languages