I want to implement debug render for cocos2d android.So I can view how bodies are created. Right now I use gdx.jar file for box2d and load that jar file following way.

static {

All the desire bodies are created but I need box2d debug renderer. I have search many place for this question but I could not found anything. So please anybody has knowledge regarding this then suggest me.


You can use GLES_Render class in TestCpp, which is located in


of the download package.

To implement the debug draw, you can draw the debug renderer with your world data after CLayer::draw(); as demonstrated in samples/TestCpp/Classes/Box2DTestBed/Box2dView.cpp ,

void Box2DView::draw()

    ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position );





If you are using old cocos2d-x library you have follow guide here.

| improve this answer | |
  • \$\begingroup\$ I think you misunderstood the platform. I am working on cocos2d android where I don't found anything you said so please give me other information that I can use. Cocos2d-Android is totally based on Java. \$\endgroup\$ – Siddharth Feb 23 '13 at 4:39
  • \$\begingroup\$ it is my mistake. you can also remove tag cocos2d-x from the question to reduce confusion. \$\endgroup\$ – neo Feb 23 '13 at 7:08
  • \$\begingroup\$ So provide me some detail on how to enable debug draw in cocos2d android. \$\endgroup\$ – Siddharth Feb 23 '13 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.