destory image in pygame

Solutions on MaxInterview for destory image in pygame by the best coders in the world

showing results for - "destory image in pygame"
Ema
09 Apr 2016
1You can fill individual images, since they are pygame Surfaces.
2
3First, what I would do is I would put something like this after defining the leaf's x/y:
4
5leaf.image = img1
6
7Then, I would create a color variable called transparent:
8
9transparent = (0, 0, 0, 0)
10
11The first 3 numbers, as you might know, represent RGB color values. The last number is the alpha (transparency) value of a color. 0 is completely invisible.
12
13Finally, I would add this code to make the leaf completely transparent:
14
15leaf.image.fill(transparent)
16
17This makes the leaf transparent without making every other image in your window disappear. Hope this helped!
María Camila
28 May 2018
1979-257-6996