R.U.B.E item classes



Rubescript defines the following item classes specific to R.U.B.E scenes:
The vec2, body, fixture and joint classes are analogous to their Box2D counterparts, eg. b2Vec2 for vec2, b2Body for body etc. The vertex class represents a single vertex of a fixture, and the shape class represents what kind of final geometry will be produced from the vertices of a fixture. The image class represents an image file.


Basic class structure
Bodies are the main hub of the class structure. They can own multiple fixtures, can have multiple images attached to them, and they can be connected to other bodies through multiple joints.

You can access the related classes of a body with these functions:
    fixture[] getFixtures();
    image[] getImages();
    joint[] getJoints();

Fixtures are owned by a body, meaning they cannot exist without one. Fixtures will always have at least one vertex. One fixture can have multiple shape types, although the creation of more than one shape is not supported via the GUI at the moment (Nov 2012).

You can access the related classes of a fixture with these functions:
    body getBody();
    vertex[] getVertices();
    shape[] getShapes();

A joint always has two bodies, bodyA and bodyB.

You can access the related bodies of a joint with these functions:
    body getBodyA();
    body getBodyB();

Images may or may not be attached to a body.

You can access the related body of an image with this function:
    body getBody();

Vertices are owned by a fixture, meaning they cannot exist without one.

You can access the related fixture of a vertex with this function:
    fixture getFixture();


Better support for shape manipulation will be added in future.


Please use the menu tree to navigate to more information about script classes.