Answers for "destory image in pygame"

0

destory image in pygame

You can fill individual images, since they are pygame Surfaces.

First, what I would do is I would put something like this after defining the leaf's x/y:

leaf.image = img1

Then, I would create a color variable called transparent:

transparent = (0, 0, 0, 0)

The 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.

Finally, I would add this code to make the leaf completely transparent:

leaf.image.fill(transparent)

This makes the leaf transparent without making every other image in your window disappear. Hope this helped!
Posted by: Guest on February-09-2021
0

destory image in pygame

979-257-6996
Posted by: Guest on August-03-2021

Python Answers by Framework

Browse Popular Code Answers by Language