Python Forum

Full Version: fill tint
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
for my pause screen I want to tint the background a bit black so you can still see the game in the back but it's darker (you have probably seen this in other video games) could I do a "screen.fill()" with a black slight alpha. how would I do so?
you have to create a new surface the same size as the screen, then set the alpha, and blit that surface at the top left. Im in a rush currently but something along the lines of

overlay_bg = pg.Surface(screen_rect.size)
overlay_bg.fill(0)
overlay_bg.set_alpha(200)
...
    #main loop
    screen.blit(overlay_bg,(0,0))