Skip to content

Instantly share code, notes, and snippets.

@llimllib

llimllib/a.py

Created Jul 23, 2020
Embed
What would you like to do?
import pyglet
window = pyglet.window.Window()
batch = pyglet.graphics.Batch()
label = pyglet.text.Label(
"Hello, world",
font_name="Times New Roman",
font_size=36,
x=window.width // 2,
y=window.height // 2,
anchor_x="center",
anchor_y="center",
batch=batch,
)
@window.event
def on_key_press(symbol, modifiers):
label.delete()
@window.event
def on_draw():
window.clear()
batch.draw()
pyglet.app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.