【问题标题】:Cocos2d-iphone display bounding boxCocos2d-iphone显示边界框
【发布时间】:2013-09-12 16:35:56
【问题描述】:

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

【问题讨论】:

  • 查看 ccConfig.h,有你可以启用的 bbox 调试宏

标签: objective-c cocos2d-iphone


【解决方案1】:

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 行,将0 更改为1。而且每个CCSpriteCCLabelTTF 现在都有一个白色的细线边界框。

【讨论】:

    猜你喜欢
    • 2012-08-21
    • 1970-01-01
    • 2021-12-02
    • 2012-07-12
    • 1970-01-01
    • 2014-11-05
    • 1970-01-01
    • 2021-09-18
    • 1970-01-01
    相关资源
    最近更新 更多