Answers for "pygame alpha"

2

pygame draw transparent rectangle

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
Posted by: Guest on November-04-2020
0

pygame surface

size = width, height = (32, 32)
empty_surface = pygame.Surface(size)
Posted by: Guest on April-22-2020

Python Answers by Framework

Browse Popular Code Answers by Language