Note that there are some explanatory texts on larger screens.

plurals
  1. POCCSpriteBatchNode assert happening when I actually don't use CCSpriteBatchNode
    primarykey
    data
    text
    <p>I'm on my way with porting <a href="https://github.com/sneakyness/SneakyInput" rel="nofollow">SneakyInput Joystick lib</a> to Cocos2d-x and I've basically managed to finish this work, but sometimes I'm getting strange CCAssert error: </p> <pre><code>CCNode::void CCSprite::addChild(CCNode *pChild, int zOrder, int tag) { // ... CCAssert( pChildSprite, "CCSprite only supports CCSprites as children when using CCSpriteBatchNode"); // SIGABRT here // ... } </code></pre> <p>On my side calling of CCNode's 'addChild' method happening here:</p> <pre><code>void SneakyButtonSkinnedBase::setButton(SneakyButton *pButton) { if (button) { if (button-&gt;getParent()) { button-&gt;getParent()-&gt;removeChild(button, true); } button-&gt;release(); } pButton-&gt;retain(); button = pButton; if (pButton) { this-&gt;addChild(button, 4); /* !!! crash here !!! */ if (defaultSprite) { button-&gt;setRadius(defaultSprite-&gt;boundingBox().size.width/2); } } /* Original iOS code */ // if(button){ // if(button.parent) // [button.parent removeChild:button cleanup:YES]; // [button release]; // } // button = [aButton retain]; // if(aButton){ // [self addChild:button z:4]; // if(defaultSprite) // [button setRadius:defaultSprite.contentSize.width/2]; // } } </code></pre> <p>I have absolutely no idea what happening: I have no any references to BatchNode class in my project (and in library too). Moreover, error appearing randomly (~7-8 times from 10 attempts). I wonder - it is a hided logic of framework? It performs some conversion when I'm trying to add several similar sprites to the layer (four navigation buttons)? So why does it work on cocos2-d without errors in this case?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload