SurroundingRectangle

Qualified name: manim.mobject.shape\_matchers.SurroundingRectangle

class SurroundingRectangle(mobject, color='#FFFF00', buff=0.1, corner_radius=0.0, **kwargs)[source]

Bases: manim.mobject.geometry.RoundedRectangle

A rectangle surrounding a Mobject

Examples

Example: SurroundingRectExample

../_images/SurroundingRectExample-1.png
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)

Methods

Attributes

animate

Used to animate the application of a method.

animation_overrides

depth

The depth of the mobject.

height

The height of the mobject.

width

The width of the mobject.