-
-
Save llimllib/9583771ead2fc100b3c0a01de87dfe58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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