R
R
Redzonetree2022-03-04 20:48:19
pygame
Redzonetree, 2022-03-04 20:48:19

How to partially clear a surface in pygame?

Hello!
I created a small drawing tool on pygame, but I still didn’t understand how to implement an eraser, since a full fill surfacedoesn’t suit me (as well as changing its A-channel), I can’t figure out how to remove ALREADY drawn on a surfacesprite, maybe it’s something worth replacing?

All sprites are in pygame.sprite.Group()
Render with .draw(surface)

(I tried to remove sprites from the group using . remove (current Sprite), but it did not help my situation)

Please tell me the solution to this problem, perhaps links to the documentation that I missed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
YariKartoshe4ka, 2022-03-06
@YariKartoshe4ka

You can't delete it, you can only paint it with something else, for example, the background color

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question