how to draw bounding box of sprites that are added to CCSpriteBatchNote

i override draw function of ccsprite. but it seem never be called. when i add the sprite to a normal ccnode that is not a ccspritebatchnode. it works fine.

void ActorSprite::draw()
{
CCSprite::draw();

if (m_editing) {
    // draw bounding box
    CCPoint vertices[4]={
        ccp(m_sQuad.tl.vertices.x,m_sQuad.tl.vertices.y),
        ccp(m_sQuad.bl.vertices.x,m_sQuad.bl.vertices.y),
        ccp(m_sQuad.br.vertices.x,m_sQuad.br.vertices.y),
        ccp(m_sQuad.tr.vertices.x,m_sQuad.tr.vertices.y),
    };
    ccDrawPoly(vertices, 4, true);
}

}

Hi,
This is because CCSpriteBatchNode doesn’t call visit (and draw) on its children. See CCSpriteBatchNode::visit().
Regards,Laurent

@laurentzubiaur thanks for your quick reply. you are right. and I call those code in batchnode’s parent. that works.