I want the following code to display a square of any transparency. I tried 255 (opaque), 0 (fully transparent), 128(half) but nothing seems to work.
pyglet.graphics.draw(4, pyglet.gl.GL_QUADS,
('v2f', (0, 0, # point0
0, 32, # point1
32, 32, # point2
32, 0) # point3
),
('c4B', (255, 0, 0, 128, # color for point0
0, 255, 0, 1, # color for point1
0, 0, 255, 255, # color for point2
0, 0, 0, 0) # color for point3
)
) # end draw()
This works fine, it makes a square with a gradient. The square is drawn on top of a sprite, I would like to be able to see the sprite trough the square.
- Pyglet v1.2.4