[Python] Issue with pygame set_alpha() setting image transparency

Discussão em 'Python' iniciado por Stack, Março 14, 2025.

  1. Stack

    Stack Membro Participativo

    Aohoj,

    in Pygame I'm trying to set the transparency of an image. I use this:

    ship = pygame.image.load(os.path.join(DIR, "spaceship.png"))
    ship.set_alpha(128)


    Problem: the code works on Mx Linux but does not work on the Raspberry Pi (Raspbian Linux). How to solve this? Could there be a problem with the Pygame version?

    Continue reading...

Compartilhe esta Página