i have this code:
import pyglet
#showing the main window and the main label
window = pyglet.window.Window(800, 600, "Hi!")
label = pyglet.text.Label('Hello world!',
font_name='Arial',
font_size=28,
x=window.width//2, y=window.height//2,
anchor_x='center', anchor_y='center')
#defining the color of the background(?)
@window.event
def on_draw():
window.clear()
label.draw()
#defining what happens when you press a key
def on_key_press(symbol, modifiers):
label1 = pyglet.text.Label('A key was pressed',
font_name='Arial',
font_size=18,
x=window.width//2, y=window.height//3,
anchor_x='center', anchor_y='centre')
pyglet.app.run()
the idea was to show a text messagge under the 'Hello world' message when i
press a key,but it not function(excuse me for my bad english,i'm only
14),please,can someone help me?
thanks!
--
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.