开发者

How to use debugdraw with MacOS / cocos2d / Box2d

开发者 https://www.devze.com 2023-03-07 15:39 出处:网络
How i can debugdraw with a cocos2d/macos code ? i cant use GLESDebu开发者_开发问答gDraw, any clue?Im not sure what you need, but cocos2d got some draw methods. You can maybe use this code

How i can debugdraw with a cocos2d/macos code ? i cant use GLESDebu开发者_开发问答gDraw, any clue?


Im not sure what you need, but cocos2d got some draw methods. You can maybe use this code

-(void)draw
{
for (NSValue* rect in spots) {
    CGRect r = [rect CGRectValue];
    CGPoint vertices2[] = {
        ccp(r.origin.x,r.origin.y),
        ccp(r.origin.x, r.size.height + r.origin.y),
        ccp(r.size.width + r.origin.x, r.size.height + r.origin.y),
        ccp(r.size.width + r.origin.x, r.origin.y)
    }; 
    ccDrawPoly(vertices2, 4, YES);
}

For other debug output, check ccConfig.h (just type it in the search field left bottom of the projekt view). On line 229 is #define CC_SPRITE_DEBUG_DRAW 0. Set it to 1 and you can see the boundingbox of all sprites.

0

精彩评论

暂无评论...
验证码 换一张
取 消