-2

I have 2 different images A and B, B is blit on top of A. I'd like to have (blit I guess) a hole in B that lets me see A through it. Can anyone help me with that? Thanks in advance.

ToeTeo
  • 1

1 Answers1

2

You can set make a hole in B before blitting it above A, using a color key (see https://www.pygame.org/docs/ref/surface.html#pygame.Surface.set_colorkey)

  • pick a color K not used in B
  • fill the "hole" in B with this color
  • set the color key of B to K
  • blit A
  • blit B

Instead of a color key you also can use alpha transparency.

thejonny
  • 488
  • 2
  • 9