How to display bounding box for sprites that are added to a CCSpriteBatchNode?

436 Views Asked by At

I have some sprites that I've added to a CCSpriteBatchNode. Everything shows up fine. Now I want to see their bounding boxes.

I've tried going into ccConfig and turning on CC_SPRITE_DEBUG_DRAW but all I get are white squares for everything: the tiles I use for the level, the characters, etc.

I can't use the draw method for the sprites as they are being drawn through the batch node and it never gets called.

I'm using cocos2d-iphone v2.0.

So is there a way to draw a bounding box for a sprite that's being drawn via the batch node?

1

There are 1 best solutions below

0
On

In ccConfig.h change

#define CC_SPRITEBATCHNODE_DEBUG_DRAW 0

to

#define CC_SPRITEBATCHNODE_DEBUG_DRAW 1

Hope this helps! p