Well, I am quite new for pyglet, I have some questions.

First, is it pyglet works fine on both Python 3 and Python 2 ? I find at 
least the 'print' state does not work on Python 3, I am afraid there are 
still big problems I will meet if I run pyglet in Python 3.

Second, is there good pyglet game example for me to learn, I find some in 
pyweek, but not enough for me. I confused a lot about pyglet, especially 
some functions do not be called, but worked, some like on_draw (is it the 
decorater window necessary?), update( where defines the dt ?), I think I 
need practice.

Third, how to creat a moving label? I have a try, but failed.


import pyglet


class MyLabel(pyglet.text.Label,pyglet.sprite.Sprite):
    def __init__(self,text,**kwargs):
        super(MyLabel,self).__init__(text,**kwargs)

window = pyglet.window.Window()

label = MyLabel('Hello, world',
                          font_name='Times New Roman',
                          font_size=36,
                          x = window.width//2, y = window.height//2)

@window.event
def on_draw():
    window.clear()
    label.draw()

def update(dt):
    label.x += dt
    
pyglet.clock.schedule_interval(update, 1/60.0)
pyglet.app.run()

so how to creat a moving label?

-- 
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 https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to