Consider the following example:
import pyglet
window = pyglet.window.Window()
batch = pyglet.graphics.Batch()
fps_display = pyglet.clock.ClockDisplay()
labels = []
for i in range(50):
labels.append(pyglet.text.Label("Index = %s" % i,
y=i*5, x=200,
font_name='Times New Roman',
#the following line degrades my
performance :(
#group=pyglet.graphics.OrderedGroup(0),
batch=batch
))
@window.event
def on_draw():
window.clear()
batch.draw()
fps_display.draw()
def update(dt):
pass
pyglet.clock.schedule(update)
pyglet.app.run()
This example runs for me on ~56 fps, but when I assign the Labels to an
OrderedGroup the fps drops down to ~7-9 fps, even though I use a batch.
Currently I avoid this problem by drawing my labels with a separate batch
and without Groups, but I'd really like to fully use the Groups-Feature of
pyglet, is there a way to avoid this performance degradiation?
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/groups/opt_out.