Umm, no sorry, I talked too fast, for some reason just on the sortAllChildren seems not to be enough, I also tried on the reorderChild but same thing, only way to work is if I really ignore the dirty_, so calling the makeDirty just before the drawNumberOfQuads:fromIndex
Re-order particles system together with sprites off a batchnode
(64 posts) (8 voices)-
Posted 10 months ago #
-
@itl, I was looking at the reordersprite branch code and not your code. I see you're reordering every frame, then makeDirty should be called every frame as well. It should also work if you add makeDirty to your sortChildren method.
Posted 10 months ago # -
Yeah, thanks, that's what I'm doing and works!!
Posted 10 months ago # -
@iti,
I am struggling with same z-sorting problem for last couple of days.
I have tried using ExtendedSpriteBatchNode as well. But still i have same issue.I have tiled map in the game with 7 layers. Character is getting added to batch node which in turn getting added to (CCTMXLayer*)tilemap.
I do following on refresh:-(void) repositionSprite:(ccTime)dt
{
// tile height is 72x36
// map size: 28x28
CGPoint p = [self positionInPixels];
[self setVertexZ: -( (p.y+36) /18) ];
}Do I need to reorder tilemap layer childs and character childs as well.
Also I can send you the test case as well.
Please do let me know.Posted 1 month ago #
Reply
You must log in to post.