>
>
> Currently the z order is mandated by:
>    The parent-child relationship between nodes
>    The z parameter you can pass in cocosnode.add( child, z=...)
>
> and the method CocosNode.visit uses that info to drive the render.
> Look at it to see if your use case can be managed with explicit z.
>

I can make some of those Bars you created go in front of others, but I 
can't make them go in front of a sprite. Here's a test code :
http://pastebin.com/TWU4DXep 
You'll need an image.png file next to the script. I can't make this Sprite 
go behind a Bar with a simple z argument.

As you suggested, I looked at CocosNode.visit, and it seems perfect for 
z-ordering, yet this code is using a BatchNode, which doesn't seem to care 
about z-ordering :
def visit(self):
        """ All children are placed in to self.batch, so nothing to visit 
"""
        glPushMatrix()
        self.transform()
        self.batch.draw()
        glPopMatrix()

So I guess it's the pyglet.graphics.Batch that has to take care of 
ordering. The code here is much too hard for me but I think it works with 
groups (that work like z-ordering).
I found this message somewhere : 
http://www.mail-archive.com/[email protected]/msg03884.html, 
and I tried using pyglet.graphics.OrderedGroup, but I still didn't manage 
to make it work.

I think the best (easiest) way will be to put those bars in their own layer 
with the z value I want.

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/cocos-discuss/-/J4EHwSjVpboJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cocos-discuss?hl=en.

Reply via email to