Skip to content

Instantly share code, notes, and snippets.

@llimllib
Created July 23, 2020 02:52
Show Gist options
  • Save llimllib/54b261544a1818d54fe341aa98ee9363 to your computer and use it in GitHub Desktop.
Save llimllib/54b261544a1818d54fe341aa98ee9363 to your computer and use it in GitHub Desktop.
import pyglet
class AWindow(pyglet.window.Window):
def __init__(self):
super(AWindow, self).__init__(100, 100)
self.batch = pyglet.graphics.Batch()
self.circle = pyglet.shapes.Circle(
50, 50, 6, color=(255, 255, 255), batch=self.batch
)
pyglet.clock.schedule_interval(self.update, 1 / 60)
def on_key_press(self, symbol, modifiers):
print("key")
self.label.delete()
def update(self, dt):
self.clear()
self.batch.draw()
if __name__ == "__main__":
window = AWindow()
pyglet.app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment