I am trying to do this:
surface_with_text = pygame.font(params).render(params) # transparent bg
surface_with_text.set_alpha(100) # make it half transparent
another_surface.blit(surface_with_text) # blit onto image
But, of course, it silently fails – my text is still fully opaque… Why so? How do I find a workaround?
Of course I can blit “255 – 100”-transparent another_surface copy on the top of the text, but what fun is that, right?
The rendered font surface is already using per-pixel alpha values (otherwise, it’d have a solid background).
From the
Font.renderdoc:From the
set_alphadoc: