I've been trying to figure out how to draw a texture within a circle with no luck.
For example, I have a red colored polygon that I drew on a surface called surf using pg.draw.polygon
. Now I want to crop that surface into a circle (see images below)
From this
The way I was doing it was:
- Create
surf1
with a white circle and black background - Create
surf2
with a white polygon and black background - Blit
surf1
intosurf2
with a multiply blend mode - Finally blit
surf2
into the main game display surface
But this is too slow to even be considered a good idea... So is there an efficient way to create this?