File hp/physics/PhysicsBody.lua

Functions

M:addCircle (x, y, radius) Add a circle.
M:addEdges (verts) Add the edge.
M:addEventListener (eventType, callback, source, priority) Adds an event listener.
M:addPhysicsData (...) Add the PhysicsData was created in PhysicsEditor.
M:addPolygon (verts) Adds a polygon.
M:addPos (x, y) 座標を設定します.
M:addRect (xMin, yMin, xMax, yMax) Add a rectangle.
M:findFixtureByName (name) Search from the name, and returns the Fixture was the first match.
M:findFixturesByName (name) Search from the name, it returns a list of Fixture match.
M:getFixtureAt (i) Returns a Fixture at the specified index.
M:getFixtures () Returns the Fixture for all.
M:getPos () Returns the position.
M:getX () Returns the position x.
M:getY () Returns the position y.
M:init () The constructor.
M:new (body) The constructor.
M:setAngle (angle) Sets angle.
M:setPos (x, y) Sets the position.
M:setX (x) Sets the position x.
M:setY (y) Sets the position y.

Tables

PhysicsBody Class that inherits from MOAIBox2DBody.


Functions

M:addCircle (x, y, radius)
Add a circle.

Parameters

  • x:
  • y:
  • radius:
M:addEdges (verts)
Add the edge.

Parameters

  • verts:
M:addEventListener (eventType, callback, source, priority)
Adds an event listener.
Also responsible for handling of Fixture.

Parameters

  • eventType:
  • callback:
  • source:
  • priority:
M:addPhysicsData (...)
Add the PhysicsData was created in PhysicsEditor.
Partially, it is proprietary.

Parameters

  • ...: fixture datas
M:addPolygon (verts)
Adds a polygon.

Parameters

  • verts:
M:addPos (x, y)
座標を設定します.

Parameters

  • x:
  • y:
M:addRect (xMin, yMin, xMax, yMax)
Add a rectangle.

Parameters

  • xMin:
  • yMin:
  • xMax:
  • yMax:
M:findFixtureByName (name)
Search from the name, and returns the Fixture was the first match.

Parameters

  • name: Fixture name.

Return value:

Fixture instance.
M:findFixturesByName (name)
Search from the name, it returns a list of Fixture match.

Parameters

  • name: Fixture name.

Return value:

Fixture instance list.
M:getFixtureAt (i)
Returns a Fixture at the specified index.

Parameters

  • i: index

Return value:

Fixture instance.
M:getFixtures ()
Returns the Fixture for all.

Return value:

Fixtures
M:getPos ()
Returns the position.

Return value:

x, y.
M:getX ()
Returns the position x.

Return value:

x
M:getY ()
Returns the position y.

Return value:

y
M:init ()
The constructor.
M:new (body)
The constructor.

Parameters

  • body: MOAIBox2DBody instance.
M:setAngle (angle)
Sets angle.

Parameters

  • angle: angle
M:setPos (x, y)
Sets the position.

Parameters

  • x:
  • y:
M:setX (x)
Sets the position x.

Parameters

  • x:
M:setY (y)
Sets the position y.

Parameters

  • y:

Tables

PhysicsBody
Class that inherits from MOAIBox2DBody.

Valid XHTML 1.0!