Difference between revisions of "B2.PolygonShape:set"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
<languages />
 
<languages />
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/b2.PolygonShape|b2.PolygonShape]]<br/>
+
'''Class:''' [[Special:MyLanguage/b2.PolygonShape|b2.PolygonShape]]<br/>
=== <translate>Description</translate> ===
+
 
<translate><br />
+
=== Description ===
Copy vertices. This assumes the vertices define a convex polygon. It is assumed that the exterior is the the right of each edge.<br />
+
Sets the vertices. This assumes the vertices define a convex polygon. It is assumed that the exterior is the the right of each edge.
<br /></translate>
 
 
<source lang="lua">
 
<source lang="lua">
b2.PolygonShape:set(vertices)
+
b2.PolygonShape:set(vertices)
 
</source>
 
</source>
=== <translate>Parameters</translate> ===
+
 
'''vertices''': (any) <translate>A list of numbers that contains the x, y coordinates of the vertices sequentially</translate> <br/>
+
=== Parameters ===
=== <translate>Examples</translate> ===
+
'''vertices''': (any) a list of numbers that contains the x, y coordinates of the vertices sequentially <br/>
'''Example'''<br/>
+
 
<source lang="lua">local polygonShape = b2.PolygonShape.new()
+
=== Examples ===
polygonShape:set(1,4, 2,6, 3,7)</source>
+
<source lang="lua">
 +
local polygonShape = b2.PolygonShape.new()
 +
polygonShape:set(1,4, 2,6, 3,7)
 +
</source>
 +
 
 +
{{B2.PolygonShape}}

Revision as of 20:50, 17 February 2020


Available since: Gideros 2011.6
Class: b2.PolygonShape

Description

Sets the vertices. This assumes the vertices define a convex polygon. It is assumed that the exterior is the the right of each edge.

b2.PolygonShape:set(vertices)

Parameters

vertices: (any) a list of numbers that contains the x, y coordinates of the vertices sequentially

Examples

local polygonShape = b2.PolygonShape.new()
polygonShape:set(1,4, 2,6, 3,7)




LiquidFun