Pygame Draw Transparent Rectangle

[Solved] Pygame Draw Transparent Rectangle | C - Code Explorer | yomemimo.com
Question : pygame draw transparent rectangle

Answered by : fancy-flatworm-4ykj7mli7542

s = pygame.Surface((1000,750)) # the size of your rect
s.set_alpha(128) # alpha level
s.fill((255,255,255)) # this fills the entire surface
windowSurface.blit(s, (0,0)) # (0,0) are the top-left coordinates

Source : https://stackoverflow.com/questions/6339057/draw-a-transparent-rectangle-in-pygame | Last Update : Wed, 11 Nov 20

Answers related to pygame draw transparent rectangle

Code Explorer Popular Question For C