Open GoogleCodeExporter opened 8 years ago
I actually tried to create something like this and wasn't able to
satisfactorily. An
element can't create its vertex lists until it has a batch (or knows that it
won't
get one). Migrating vertex lists from one batch or group to another is
hideously
expensive (by design -- this was never intended to be an important use-case),
which
is why only Sprite currently supports it.
Is it really so hard to create the batch first, and then add elements to it?
Doing
it the other way around requires either a two-stage construction process (first
construct the object, then add it to the batch and create its vertex lists), or
a
migration or recreation of vertex lists.
If you have a patch that implements this I'd be very interested to see it.
I'll keep
this request in mind, but I don't think it will make it into pyglet 1.1, as
it's not
trivial (and, IMO, not necessary once you adapt to a certain style of writing).
Original comment by Alex.Hol...@gmail.com
on 17 Apr 2008 at 2:29
Original comment by Alex.Hol...@gmail.com
on 17 Apr 2008 at 2:30
Its not that creating the batch is hard, its just not the way i want to do it.
In
cocos you create an object and then add it to a layer or sprite or scene or a
batchnode. if the object you add to is a batchnode(or descendant), the added
abjects
batch and group elements are set so that z-order is respected and composition
also (a
batchnode, with a sprite that has a sprite.. etc).
having to have the batch in hand before creating the nodes makes it very
different as
how everything else is created and managed. it also makes you hand manage all
the
groups stuff that now its set up automatically.
the way i can implement it is doing a two phase creation as you said, but of a
cocos
element, that creates a new label when it needs one. but i was hoping people
could
still use pyglets interfaces for drawing.
Original comment by lucio.to...@gmail.com
on 17 Apr 2008 at 9:18
Original issue reported on code.google.com by
lucio.to...@gmail.com
on 17 Apr 2008 at 9:18