Hi.I'm new in pyglat and python. I write my first code. And i have one
question how to write my animations when i click WSAD or other
buttons.
[CODE]
from pyglet import font
from pyglet import window
from pyglet.window import key
from pyglet import image
#amunicja zycia,punkty
okno =
window.Window(caption='testy',style=window.Window.WINDOW_STYLE_DIALOG)
ft = font.load('Arial', 13,bold=True)
#--------------------------------
#animacja(animation)
obrazek =image.load('explosion.png')
obrazek_seq=image.ImageGrid(obrazek, 1,8)
start_frames = obrazek_seq[:7]
#-------------------------------
text = font.Text(ft, 'Zycia \nAmunicja
\nPunkty',x=20,y=okno.height-20)
#guziki(buttons)
def on_key_press(symbol, modifiers):
if symbol == key.W:
text.y += 5
elif symbol == key.S:
text.y += -5
elif symbol == key.A:
text.x += -5
elif symbol == key.D:
text.x += 5
#-----------------------------------
okno.on_key_press = on_key_press
while not okno.has_exit:
okno.dispatch_events()
text.draw()
okno.flip()
obrazek.blit(100,111)
okno.clear()
[/code]
And my other question. How to make graphic button i try make GUI.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
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/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---