from math import * from time import * from pyglet.gl import * window = pyglet.window.Window() text = pyglet.text.Label('This is a test', font_name='Times New Roman', font_size=20) @window.event def on_draw(): glClear(pyglet.gl.GL_COLOR_BUFFER_BIT) text.draw() def update(dt): pass # text.x = 200+200*sin(time()) # text.y = 200+200*cos(time()) text.text = 'The time is %f' % (time()) # text.font_size = 30+10*sin(time()) text.color = (int(sin(time())*127+128), int(cos(time())*127+128), 255, 255) pyglet.clock.schedule_interval(update,1/60.0) pyglet.app.run()