RoundedRectangle¶
Qualified name: manim.mobject.geometry.polygram.RoundedRectangle
- class RoundedRectangle(corner_radius=0.5, **kwargs)[source]¶
Bases:
RectangleA rectangle with rounded corners.
- Parameters:
corner_radius (float | list[float]) – The curvature of the corners of the rectangle.
kwargs (Any) – Additional arguments to be passed to
Rectangle
Examples
Example: RoundedRectangleExample ¶
from manim import * class RoundedRectangleExample(Scene): def construct(self): rect_1 = RoundedRectangle(corner_radius=0.5) rect_2 = RoundedRectangle(corner_radius=1.5, height=4.0, width=4.0) rect_group = Group(rect_1, rect_2).arrange(buff=1) self.add(rect_group)
class RoundedRectangleExample(Scene): def construct(self): rect_1 = RoundedRectangle(corner_radius=0.5) rect_2 = RoundedRectangle(corner_radius=1.5, height=4.0, width=4.0) rect_group = Group(rect_1, rect_2).arrange(buff=1) self.add(rect_group)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.
- _original__init__(corner_radius=0.5, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
corner_radius (float | list[float])
kwargs (Any)