Hi all,
Apologies for the seemingly newb help request but I can't seem to
figure out how to vary the alpha value of rendered font surfaces. Here
are my attempts thusfar:
import pygame
pygame.init()
screen = pygame.display.set_mode((640,480), pygame.SRCALPHA)
screen.fill((0,0,0))
myFont = pygame.font.Font(None, 30)
nonTransparent = myFont.render("This text should be fully opaque", 1,
(255,255,255))
screen.blit(nonTransparent, (0,0))
semiTransparent = myFont.render("This text should be somewhat
transparent", 1, (255,255,255))
semiTransparent.set_alpha(100)
screen.blit(semiTransparent, (0,100))
pygame.display.flip()
#When I flip, both messages are the same color, indicating that the
transparency on the second failed