Skip to content

kamilbeben/jbox2dDebugRenderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Jbox2D Debug Renderer

This renderer is adapted to Jbox2D version 2.2.1.1 It will probably work with other versions, but it may need a few changes

Currently implemented shapes: CircleShape, PolygonShape, EdgeShape and joints.

Example of uses:

Quick start, with default settings

    public Physics() {
        world = new World(gravity);
        new JBox2DDebugRenderer(world, 5);
    }

Customizable

    public Physics() {
        world = new World(gravity);
        Jbox2DDebugConfig config = new Jbox2DDebugConfig();
        config.setPixelsPerUnit(PPU);
	config.setColorPolygon(Color.BLUE);
        new JBox2DDebugRenderer(world, config, 5);
    }

You can set-up following things:

    public void setTitle(String title);

    public void setColorBackground(Color colorBackground);

    public void setColorPolygon(Color colorPolygon);

    public void setColorCircle(Color colorCircle);

    public void setColorEdge(Color colorEdge);

    public void setAlpha(float alpha);

About

Debug renderer for jBox2D

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages