Difference between revisions of "love.graphics.polygon"

m (added external link to Wikipedia regarding the term convex)
(redid part of edit lost to crash)
Line 1: Line 1:
 
Draw a polygon.
 
Draw a polygon.
 +
 +
Following the mode argument, this function can accept multiple numeric arguments or a single table of numeric arguments. In either case the arguments are interpreted as alternating x and y coordinates of the polygon's vertices.
  
 
''Note: when in '''fill''' mode, the polygon must be [http://en.wikipedia.org/wiki/Convex_and_concave_polygons convex] or rendering artifacts may occur.''
 
''Note: when in '''fill''' mode, the polygon must be [http://en.wikipedia.org/wiki/Convex_and_concave_polygons convex] or rendering artifacts may occur.''
Line 12: Line 14:
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
 +
=== Synopsis ===
 +
<source lang="lua">
 +
love.graphics.polygon( mode, vertices )
 +
</source>
 +
=== Arguments ===
 +
{{param|DrawMode|mode|How to draw the polygon.}}
 +
{{param|table|vertices|The vertices of the polygon as a table.}}
 +
=== Returns ===
 +
Nothing.
 +
 
== See Also ==
 
== See Also ==
 
* [[parent::love.graphics]]
 
* [[parent::love.graphics]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Draw a polygon.}}
 
{{#set:Description=Draw a polygon.}}

Revision as of 17:12, 9 April 2010

Draw a polygon.

Following the mode argument, this function can accept multiple numeric arguments or a single table of numeric arguments. In either case the arguments are interpreted as alternating x and y coordinates of the polygon's vertices.

Note: when in fill mode, the polygon must be convex or rendering artifacts may occur.

Function

Synopsis

love.graphics.polygon( mode, ... )

Arguments

DrawMode mode
How to draw the polygon.
numbers ...
The vertices of the polygon.

Returns

Nothing.

Synopsis

love.graphics.polygon( mode, vertices )

Arguments

DrawMode mode
How to draw the polygon.
table vertices
The vertices of the polygon as a table.

Returns

Nothing.

See Also