SurroundingRectangle¶
Qualified name: manim.mobject.geometry.shape\_matchers.SurroundingRectangle
- class SurroundingRectangle(*mobjects, color=ManimColor('#FFFF00'), buff=0.1, corner_radius=0.0, **kwargs)[source]¶
Bases:
RoundedRectangleA rectangle surrounding a
MobjectExamples
Example: SurroundingRectExample ¶
from manim import * class SurroundingRectExample(Scene): def construct(self): title = Title("A Quote from Newton") quote = Text( "If I have seen further than others, \n" "it is by standing upon the shoulders of giants.", color=BLUE, ).scale(0.75) box = SurroundingRectangle(quote, color=YELLOW, buff=MED_LARGE_BUFF) t2 = Tex(r"Hello World").scale(1.5) box2 = SurroundingRectangle(t2, corner_radius=0.2) mobjects = VGroup(VGroup(box, quote), VGroup(t2, box2)).arrange(DOWN) self.add(title, mobjects)
class SurroundingRectExample(Scene): def construct(self): title = Title("A Quote from Newton") quote = Text( "If I have seen further than others, \n" "it is by standing upon the shoulders of giants.", color=BLUE, ).scale(0.75) box = SurroundingRectangle(quote, color=YELLOW, buff=MED_LARGE_BUFF) t2 = Tex(r"Hello World").scale(1.5) box2 = SurroundingRectangle(t2, corner_radius=0.2) mobjects = VGroup(VGroup(box, quote), VGroup(t2, box2)).arrange(DOWN) self.add(title, mobjects)Methods
Attributes
alwaysCall a method on a mobject every frame.
animateUsed to animate the application of any method of
self.animation_overridescolordepthThe depth of the mobject.
fill_colorIf there are multiple colors (for gradient) this returns the first one
heightThe height of the mobject.
n_points_per_curvesheen_factorstroke_colorwidthThe width of the mobject.
- Parameters:
mobjects (Mobject)
color (ParsableManimColor)
buff (float | tuple[float, float])
corner_radius (float)
kwargs (Any)
- _original__init__(*mobjects, color=ManimColor('#FFFF00'), buff=0.1, corner_radius=0.0, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
mobjects (Mobject)
color (ParsableManimColor)
buff (float | tuple[float, float])
corner_radius (float)
kwargs (Any)
- Return type:
None