{{newin (日本語)|[[0.4.0 (日本語)|0.4.0]]|040|type=関数}}
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.

{{notice|When in '''fill''' mode, the polygon must be [http://en.wikipedia.org/wiki/Convex_polygon convex] and [http://en.wikipedia.org/wiki/Simple_polygon simple] or rendering artifacts may occur. [[love.math.triangulate]] and [[love.math.isConvex]] can be used in [[0.9.0]]+.}}
== 関数 ==
=== 概要 ===
<source lang="lua">
love.graphics.polygon( mode, ... )
</source>
=== 引数 ===
{{param (日本語)|DrawMode|mode|How to draw the polygon.}}
{{param (日本語)|number|...|The vertices of the polygon.}}
=== 返値 ===
ありません。
== 関数 ==
=== 概要 ===
<source lang="lua">
love.graphics.polygon( mode, vertices )
</source>
=== 引数 ===
{{param (日本語)|DrawMode|mode|How to draw the polygon.}}
{{param (日本語)|table|vertices|The vertices of the polygon as a table.}}
=== 返値 ===
ありません。
== 用例 ==
=== Two ways of drawing the same triangle ===
[[File:Polygon_triangle.png|upright=0.5|thumb|right|top|Triangle drawn using love.graphics.polygon]]
This example shows how to give the coordinates explicitly and how to pass a table argument.
<source lang="lua">
-- giving the coordinates directly
love.graphics.polygon('fill', 100, 100, 200, 100, 150, 200)

-- defining a table with the coordinates
-- this table could be built incrementally too
local vertices = {100, 100, 200, 100, 150, 200}

-- passing the table to the function as a second argument
love.graphics.polygon('fill', vertices)
</source>

== 関連 ==
* [[parent::love.graphics (日本語)]]
* [[love.math.triangulate (日本語)]]
* [[love.math.isConvex (日本語)]]
[[Category:Functions (日本語)]]
[[Sub-Category::Drawing (日本語)| ]]
{{#set:Description=Draw a polygon.}}
== そのほかの言語 ==
{{i18n (日本語)|love.graphics.polygon}}