Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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!
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #destory #image #pygame
ADD COMMENT
Topic
Name
9+1 =