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_DRAW行を に変更01ます。また、すべてCCSpriteの にCCLabelTTF、白いヘアライン境界ボックスが追加されました。

于 2013-09-08T10:41:37.243 に答える