Advertisement
Guest User

Untitled

a guest
May 21st, 2013
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. import pyglet
  2. from pyglet.window import *
  3.  
  4. window = pyglet.window.Window()
  5.  
  6. label = pyglet.text.Label('Hello, world',
  7.                           font_name='Times New Roman',
  8.                           font_size=36,
  9.                           x=window.width//2, y=window.height//2,
  10.                           anchor_x='center', anchor_y='center')
  11.                          
  12.                  
  13.                          
  14. @window.event
  15. def on_draw():
  16.     window.clear()  
  17.     label.draw()
  18.    
  19.     imageData = pyglet.image.ImageData(3, 3, 'RGB', [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0 ])
  20.     imageData.blit(10, 10)
  21.    
  22. pyglet.app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement