another strange thing, with SpriteBatchNode I need to manually increase atlas capacity using increaseAtlasCapacity when adding a child to the batch node else
1/ app crache here
void SpriteBatchNode::swap(ssize_t oldIndex, ssize_t newIndex)
{
CCASSERT(oldIndex>=0 && oldIndex < (int)_descendants.size() && newIndex >=0 && newIndex < (int)_descendants.size(), “Invalid index”);
or
2/no crash but not rendered
Any idea?
Since i build all my project from beta1 to beta2 I’m really asking if it was a good idea to start a new project with V3
Please reply about this and previous question (EventListenerTouchAllAtOnce looks not working), I’m really afraid to continu my project.
the problem with beta 2 is:
when you reach atlas capacity and you add a sprite in the batchnode we have
cocos2d: cocos2d: SpriteBatchNode: resizing TextureAtlas capacity from [29] to [40]. -> this is normal
BUT
the sprite is not rendered because he has the same texture that the other one…
@fabrice I met this multi-touch problem (ios), that’s because no open multi-touch mode of the rootviewconctroller, you have to start it:[__glView setMultipleTouchEnabled:YES];
@ricardo@walzer@zhangxm In cocos2dx 2.x.x and cocos2dx 3.0 alpha,(CC)Sprite’s draw() function is different from 3.0 beta Sprite’s draw(),which cause this problem: “In old versions,if I wrote something like DrawSolidRect() in draw() function,and create a Sprite in that layer,the DrawSolidRect()'s effect would be covered by the Sprite.So we set the Sprite’s ZOrder to -1,and so it is smaller than zero(http://blog.csdn.net/crayondeng/article/details/12585479 ),which solved my problem. But now,I changed my platform to cocos2dx 3.0 beta2, the new Sprite’s draw() make that “ZOrder solution” doesn’t work any more. No matter how small the ZOrder is,DrawSolidRect() always be covered forever”.
I doubt that 3.0 beta’s Sprite new draw() is imperfect,although it’s neater than old draw(). I tried to understand the new draw() and fix it,but I don’t have time enough.So Anybody knows why? and how to solve the “DrawSolidRect() covered”'s problem in 3.0 beta.
@naghekyan heh…The only thing we could do is to use order versions.I saw the new Sprite’s draw(),it seems too complex(over packed,like some frameworks in J2EE) to fix it ourselves and would waste much time.