You are here: Lua Scripting Resources eGuide > Lua Scripting API Reference Guide > Physics Library > PolyShape

19.7.1 PolyShape

ps = physics.PolyShape(body, vertices, offset)

Parameter

Type

Description

body

in physics.Body

A Body or nil

vertices

in {physics.Vect}

The list of vertices that define the boundaries of the
polygon defined in counterclockwise order

offset

in physics.Vect

The offset of the PolyShape from the Body

ps

out physics.PolyShape

A new PolyShape

Returns a new PolyShape with the given body, table of vertices, and offset from the body’s center of gravity. Specify nil for the body to use the space’s static body.

Introduced in platform.apiLevel = '2.0'