ManimCommunity / manim

A community-maintained Python framework for creating mathematical animations.
https://www.manim.community
MIT License
26.48k stars 1.82k forks source link

SurroundingRectangle supports *mobjects #3863

Open MrDiver opened 4 months ago

MrDiver commented 4 months ago

Quickfix for SurroundingRectangle to add the functionality to surround multiple objects without creating an extra VGroup

Boris-Filin commented 1 month ago

Hello there! We have to do some OSC for uni (I know, I know...), and I would like to take a swing at this fix. I am thinking that this could be done by creating a temporary VGroup under the hood inside SurroundingRectangle itself. As for syntaxis, I think it would make most sense to add a classmethod such as "mobjects" that would be separate to the main constructor, while still providing the necessary functionality.

box = SurroundingRectangle.mobjects([quote, title], color=YELLOW, buff=MED_LARGE_BUFF)

Would you mind if I take this issue? I'd appreciate any notes you have on the above ideas.