| 1 | """Demonstrates creation of a transparent overlay window in pyglet |
| 2 | """ |
| 3 | |
| 4 | import pyglet |
| 5 | |
| 6 | from pyglet.graphics import Batch |
| 7 | from pyglet.window import Window |
| 8 | |
| 9 | |
| 10 | batch = Batch() |
| 11 | window = Window(500, 500, style=Window.WINDOW_STYLE_OVERLAY) |
| 12 | window.set_caption("Overlay Window") |
| 13 | |
| 14 | circle = pyglet.shapes.Circle(250, 250, 100, color=(255, 255, 0), batch=batch) |
| 15 | |
| 16 | |
| 17 | @window.event |
| 18 | def on_draw(): |
| 19 | window.clear() |
| 20 | batch.draw() |
| 21 | |
| 22 | |
| 23 | pyglet.app.run() |