Manual drawing

Manual drawing
0.0 0


Hello, I’m using box2d debug draw posted somewhere in this forum. The example has 2 classes: debug draw inhereted from b2DebugDraw and the new layer which overrides draw method and call something like:



So, it works perfect but now I want to use that code outside the layer. So, throw out the layer class and leave only implementation of box2d’s debug draw. I’ve added schedule for game update tick:
void tick(float dt)
// Here is called the first part of code I published

Tick function is called but nothing happens, the screen is black. As I understand, that functions work only in draw-methods of node/layer. Any way to force that environment and NOT to create the new layer class with overwritten draw method? I just want to call the render code outside.

s. Don’t tell me, please, about architecture of cocos2d-x, I know that the ability to do what I want isn’t approved “by design”.