Pygame surface with alpha not blitting transparency
问题 I'm trying to make a user interface thing transparent in my game when the mouse isn't hovering over it. But for some reason, when I set the alpha value of the image for it to become transparent, nothing happens. Here is some runnable code for it that replicates the problem: import pygame WHITE = (255, 255, 255) class UI: def __init__(self): self.img = pygame.image.load("ink_bar_solid.png") self.img.set_alpha(0) self.ink_bar_rect = self.img.get_bounding_rect() self.x, self.y = 0, 10 resolution