This is a program I'm writing that's supposed to display some text in a window...
import pyglet
from pyglet import window
from pyglet.text.layout import TextLayout
class Window(pyglet.window.Window):
def __init__(self):
super(Window, self).__init__(width = 800, height = 600,
caption = "Prototype")
self.disclaimer = pyglet.text.Label("Hello World",
font_name = 'Times New Roman',
font_size=36,
color = (255, 255, 255, 255),
x = TextLayout.width / 2,
y = TextLayout.height / 2,
anchor_x='center', anchor_y='center')
def on_draw(self):
self.clear()
self.disclaimer.draw()
if __name__ == '__main__':
window = Window()
pyglet.app.run()
...however every time I try to run it I get this error
line 16
x = TextLayout.width / 2,
TypeError: unsupported operand type(s) for /: 'property' and 'int'
I'm pretty sure this means that I tried to divide a string but in the Pyglet Documentation it says that width and height are ints. I have no idea what I'm doing wrong.