Ok, I honestly don't have a deep enough knowledge of cocos/pyglet/openGL,
but I managed to get my batches to do what I ask of them (respect the
z-order I want), by changing the usage of pyglet Group to OrderedGroup :
the only change I made is this, in batch.BatchableNode :
def set_batch(self, batch, groups=None, z=0):
self.batch = batch
if batch is None:
self.group = None
else:
group = groups.get(z)
if group is None:
import pyglet
group = pyglet.graphics.OrderedGroup(z) # this is the only line
I changed
groups[z] = group
self.group = group
for childZ, child in self.children:
child.set_batch(self.batch, groups, z + childZ)
It seems that it used to be OrderedGroups, but this changed in
r807<https://code.google.com/p/los-cocos/source/detail?spec=svn807&r=807>,
and every commit made since that time was for licence and such... I really
don't know if this change will create some other problems, some performance
troubles or anything, all I know is that it's currently doing the job for
my current needs.
Le jeudi 10 janvier 2013 21:55:17 UTC+1, Nitneroc a écrit :
>
> I haven't been able to use cocos lately, and I realize I have forgotten
> many thnigs...
>
> It seems that batches don't take care of ordering, but I really need the
> speed of a batch and careful ordering. Is this even possible ? should I use
> pyglet batches instead of cocos ones ? Is there a workaround ?
> I tried to correct this with no luck, could someone point me in the right
> direction ?
>
--
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/-/TJePzGyk8fEJ.
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.