MyreMylar / pygame_gui

A GUI system for pygame.
MIT License
698 stars 83 forks source link

Add a combination of drawable_shape #516

Open LondonClass opened 9 months ago

LondonClass commented 9 months ago

The drawable shape combination can bind a set of drawable shapes together and operate like a separate drawable shape. This way, complex shapes can be achieved by combining drawable_shape.

Actually, it may be a good idea to divide the text and image parts of drawable_shape into two parts.

MyreMylar commented 8 months ago

Text and image are already pretty separate right now so I expect this could be refactored reasonably easily. Text happens mostly in it's own submodule and gets drawn on top at the end.

You could probably define a new DrawableShape that was a combination of any underlying shapes you want, the base shape drawing part isn't that tough and follows a pretty similar process for circles, rectangles and rounded rectangles. IIRC there are a few optimisations here and there depending on the base shape, but if you wanted triangular shapes or star shapes it should all be doable, maybe a basic filled polygon shape is the way to go to cover lots of bases?