We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
When trying to set bounding box in ccConfig.h getting compilation error
When trying to set bounding box in ccConfig.h getting compilation error
The CC_SPRITEBATCHNODE_DEBUG_DRAW define not even appear any where in the code , only in the ccConfig.h file.
few more things ,
the fix to the ccDrawPoly is to replace it with DrawPrimitives::drawPoly(vertices, 4, true);
BUT , as i see in the CCSprite class , the bounding box is drawen only when using as being rendered using an SpriteBatchNode.
and never other case , this is problem when your sprite is not part of SpriteBatchNode.
for example using Sprite as Animation container for SpriteFrame's
for now i just overwrite the draw method of the Sprite to draw bounding box like this :
void MySprite::draw() { Sprite::draw(); _customCommand.init(_globalZOrder); _customCommand.func = CC_CALLBACK_0(Block::onDraw, this); Director::getInstance()->getRenderer()->addCommand(&_customCommand); } void MySprite::onDraw() { kmMat4 oldMat; kmGLGetMatrix(KM_GL_MODELVIEW, &oldMat); kmGLLoadMatrix(&_modelViewTransform); //draw CHECK_GL_ERROR_DEBUG(); // draw bounding box Point vertices[4] = { Point( _quad.bl.vertices.x, _quad.bl.vertices.y ), Point( _quad.br.vertices.x, _quad.br.vertices.y ), Point( _quad.tr.vertices.x, _quad.tr.vertices.y ), Point( _quad.tl.vertices.x, _quad.tl.vertices.y ), }; //ccDrawPoly(vertices, 4, true); DrawPrimitives::drawPoly(vertices, 4, true); //end draw kmGLLoadMatrix(&oldMat); }
Redmine issue system is closed, we are using github issue system instead.
This issue was moved to https://github.com/cocos2d/cocos2d-x/issues/8327
Status: | Closed | |
---|---|---|
Start date: | 2014-01-26 | |
Priority: | Low | |
Due date: | ||
Assignee: | - | |
% Done: | 0% |
|
Category: | native client, windows | |
Target version: | - |
I try to set the configuration incocos2d-x-3.0beta\cocos2d-x-3.0beta\cocos\2d\ccConfig.h
like this :
`#ifndef CC_SPRITE_DEBUG_DRAW
define CC_SPRITE_DEBUG_DRAW 1¶
endif¶
ifndef CC_SPRITEBATCHNODE_DEBUG_DRAW¶
define CC_SPRITEBATCHNODE_DEBUG_DRAW 1¶
endif`¶
im getting compilation error :
tested on windows 7 64bit with visual studio2012 express