BraceText¶
Qualified name: manim.mobject.svg.brace.BraceText
- class BraceText(obj, text, label_constructor=<class 'manim.mobject.text.text_mobject.Text'>, **kwargs)[source]¶
Bases:
BraceLabelCreate a brace with a text label attached.
- Parameters:
obj (Mobject) – The mobject adjacent to which the brace is placed.
text (str) – The label text.
brace_direction – The direction of the brace. By default
DOWN.label_constructor (type[SingleStringMathTex | Text]) – A class or function used to construct a mobject representing the label. By default
Text.font_size – The font size of the label, passed to the
label_constructor.buff – The buffer between the mobject and the brace.
brace_config – Arguments to be passed to
Brace.kwargs (Any) – Additional arguments to be passed to
VMobject.
Examples
Example: BraceTextExample ¶
from manim import * class BraceTextExample(Scene): def construct(self): s1 = Square().move_to(2*LEFT) self.add(s1) br1 = BraceText(s1, "Label") self.add(br1) s2 = Square().move_to(2*RIGHT) self.add(s2) br2 = BraceText(s2, "Label") br2.change_label("new") self.add(br2) self.wait(0.1)
class BraceTextExample(Scene): def construct(self): s1 = Square().move_to(2*LEFT) self.add(s1) br1 = BraceText(s1, "Label") self.add(br1) s2 = Square().move_to(2*RIGHT) self.add(s2) br2 = BraceText(s2, "Label") br2.change_label("new") self.add(br2) self.wait(0.1)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__(obj, text, label_constructor=<class 'manim.mobject.text.text_mobject.Text'>, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
obj (Mobject)
text (str)
label_constructor (type[SingleStringMathTex | Text])
kwargs (Any)