Objective c Cocos2d iphone显示边界框

Objective c Cocos2d iphone显示边界框,objective-c,cocos2d-iphone,Objective C,Cocos2d Iphone,如何在不使用任何框架的情况下显示边界框。只是普通的cocos2d?在cocos2d中有非常酷的功能,搜索ccConfig.h,在那里你会找到以下部分: /** @def CC_SPRITE_DEBUG_DRAW If enabled, all subclasses of CCSprite will draw a bounding box. Useful for debugging purposes only. It is recommended to leave it disabled. If

如何在不使用任何框架的情况下显示边界框。只是普通的cocos2d?

在cocos2d中有非常酷的功能,搜索ccConfig.h,在那里你会找到以下部分:

/** @def CC_SPRITE_DEBUG_DRAW
If enabled, all subclasses of CCSprite will draw a bounding box.
Useful for debugging purposes only. It is recommended to leave it disabled.

If the CCSprite is being drawn by a CCSpriteBatchNode, the bounding box might be a bit different.
To enable set it to a value different than 0. Disabled by default:
0 -- disabled
1 -- draw bounding box
2 -- draw texture box
*/
#ifndef CC_SPRITE_DEBUG_DRAW
#define CC_SPRITE_DEBUG_DRAW 0
#endif

将定义CC_SPRITE_DEBUG_DRAW的行0更改为1。每个CCSprite和CCLabelTTF现在都有一个白色的边界框。

查看ccConfig.h,可以启用bbox调试宏