B2.PolygonShape:set: Difference between revisions
From GiderosMobile
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
'''Available since:''' Gideros 2011.6<br/> | '''Available since:''' Gideros 2011.6<br/> | ||
=== Description === | === Description === | ||
<br /> | <translate><br /> | ||
Copy vertices. This assumes the vertices define a convex polygon. It is assumed that the exterior is the the right of each edge.<br /> | Copy vertices. This assumes the vertices define a convex polygon. It is assumed that the exterior is the the right of each edge.<br /> | ||
<br /> | <br /></translate> | ||
<source lang="lua"> | <source lang="lua"> | ||
b2.PolygonShape:set(vertices) | b2.PolygonShape:set(vertices) | ||
</source> | </source> | ||
=== Parameters === | === Parameters === | ||
'''vertices''': (any) A list of numbers that contains the x, y coordinates of the vertices sequentially <br/> | '''vertices''': (any) <translate>A list of numbers that contains the x, y coordinates of the vertices sequentially</translate> <br/> | ||
=== Examples === | === Examples === | ||
'''Example'''<br/> | '''Example'''<br/> | ||
<source lang="lua">local polygonShape = b2.PolygonShape.new() | <source lang="lua">local polygonShape = b2.PolygonShape.new() | ||
polygonShape:set(1,4, 2,6, 3,7) | polygonShape:set(1,4, 2,6, 3,7)</source> | ||
Revision as of 12:34, 23 August 2018
Available since: Gideros 2011.6
Description
Copy 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
Example
local polygonShape = b2.PolygonShape.new()
polygonShape:set(1,4, 2,6, 3,7)