Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. import pyglet
  2. from pyglet.gl import *
  3. from pyglet.window import key
  4. from pyglet.window import mouse
  5.  
  6. window = pyglet.window.Window(900, 600, resizable=True)
  7. window.set_minimum_size(200, 100)
  8. batch = pyglet.graphics.Batch()
  9. i = 0
  10.  
  11.  
  12. @window.event
  13. def on_draw():
  14. window.clear()
  15.  
  16. hexo = batch.add(6, pyglet.gl.GL_POLYGON, None,
  17. ('v2i', (300, 300, 375, 175, 525, 175, 600, 300, 525, 425, 375, 425)),
  18. ('c3B', (87, 6, 6, 5, 22, 84, 40, 9, 125, 127, 4, 4, 20, 1, 1, 0, 12, 17)))
  19.  
  20. hexo2 = batch.add(6, pyglet.gl.GL_POLYGON, None,
  21. ('v2i', (300, 300, 375, 175, 525, 175, 600, 300, 525, 425, 375, 425)),
  22. ('c3B', (255, 255, 255) * 6))
  23.  
  24.  
  25. batch.draw()
  26.  
  27.  
  28. @window.event
  29. def on_resize(width, height):
  30. glViewport(0, 0, width, height)
  31.  
  32.  
  33. @window.event
  34. def on_key_press(symbol, modifiers):
  35. if (symbol == key.LEFT) | (symbol == key.A):
  36. i = 1
  37.  
  38.  
  39. pyglet.app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement