How to manage zorder of sprites in multiple batchnodes?

I have to use sprites in multiple batchnodes, but I found all sprites in one batchnode are in front of or behind the sprites in another batchnode…I need to make some sprites in batchnode A in front of batchnode B, and at the same time some sprites in batchnode A behind batchnode B.

I have tried this: http://www.cocos2d-x.org/forums/6/topics/25129
and this: http://www.cocos2d-iphone.org/forums/topic/re-order-particles-system-together-with-sprites-off-a-batchnode/

but there are some problems…
For example, it should be like this:

but now it is like this:

Is there any other ways to solve this problem?


wp_ss_20131012_0003.png (386.5 KB)


wp_ss_20131012_0002.png (381.8 KB)