B2.PolygonShape:set: Difference between revisions

From GiderosMobile
No edit summary
m Text replacement - "</source" to "</syntaxhighlight"
Line 8: Line 8:
<source lang="lua">
<source lang="lua">
b2.PolygonShape:set(vertices)
b2.PolygonShape:set(vertices)
</source>
</syntaxhighlight>


=== Parameters ===
=== Parameters ===
Line 17: Line 17:
local polygonShape = b2.PolygonShape.new()
local polygonShape = b2.PolygonShape.new()
polygonShape:set(1,4, 2,6, 3,7)
polygonShape:set(1,4, 2,6, 3,7)
</source>
</syntaxhighlight>


{{B2.PolygonShape}}
{{B2.PolygonShape}}

Revision as of 15:34, 12 July 2023


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. <source lang="lua"> b2.PolygonShape:set(vertices) </syntaxhighlight>

Parameters

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

Examples

<source lang="lua"> local polygonShape = b2.PolygonShape.new() polygonShape:set(1,4, 2,6, 3,7) </syntaxhighlight>




LiquidFun