Difference between revisions of "B2.PolygonShape:set"
From GiderosMobile
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | '''Available since:''' Gideros 2011.6<br/> | + | '''<translate>Available since</translate>:''' Gideros 2011.6<br/> |
− | === Description === | + | === <translate>Description</translate> === |
<translate><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 /> | ||
Line 8: | Line 8: | ||
b2.PolygonShape:set(vertices) | b2.PolygonShape:set(vertices) | ||
</source> | </source> | ||
− | === Parameters === | + | === <translate>Parameters</translate> === |
'''vertices''': (any) <translate>A list of numbers that contains the x, y coordinates of the vertices sequentially</translate> <br/> | '''vertices''': (any) <translate>A list of numbers that contains the x, y coordinates of the vertices sequentially</translate> <br/> | ||
− | === Examples === | + | === <translate>Examples</translate> === |
'''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)</source> | polygonShape:set(1,4, 2,6, 3,7)</source> |
Revision as of 07:29, 24 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)