1

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

4

1 回答 1

0

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

换行#define CC_SPRITE_DEBUG_DRAW01。而every CCSprite,soCCLabelTTF现在也有一个白色的细线边界框。

于 2013-09-08T10:41:37.243 回答