import pyglet
from pyglet import shapes
from pyglet import gl
gl.glClearColor(0, 0, 0, 0)
pyglet.window.Window()
gl.glClearColor(0,0,0,0)
circle = shapes.Circle(x=100, y=150, radius=100, color=(50, 225, 30))
square = shapes.Rectangle(x=200, y=200, width=200, height=200, color=(55, 55, 255))
rectangle = shapes.Rectangle(x=400, y=400, width=100, height=50)
# 设置锚点
rectangle.anchor_x = 50
rectangle.anchor_y = 25
# or, set at the same time:
rectangle.anchor_position = 50, 25
# The rectangle is then rotated around it's anchor point:
rectangle.rotation = 45
# 改变圆形的不透明度(0~255)
circle.opacity = 120
# 改变图形的大小
square.width = 200
circle.radius = 99
pyglet.app.run()
为什么没有改变背景颜色