Okay guys, I'm trying to fade out an image. So given this:
img_ = pygame.image.load('circle.png')
screen.blit(img_, [100, 100])
how can I change the opacity of img_
? Thanks!
Okay guys, I'm trying to fade out an image. So given this:
img_ = pygame.image.load('circle.png')
screen.blit(img_, [100, 100])
how can I change the opacity of img_
? Thanks!
Pygame surfaces have a method named set_alpha()
for this, which takes a value between 0 and 255.
Relevant docs: https://www.pygame.org/docs/ref/surface.html#pygame.Surface.set_alpha