LabeledDot¶
Qualified name: manim.mobject.geometry.arc.LabeledDot
- class LabeledDot(label, radius=None, buff=0.1, **kwargs)[source]¶
Bases:
DotA
Dotcontaining a label in its center.- Parameters:
label (str | SingleStringMathTex | Text | Tex) – The label of the
Dot. This is rendered asMathTexby default (i.e., when passing astr), but other classes representing rendered strings likeTextorTexcan be passed as well.radius (float | None) – The radius of the
Dot. If provided, thebuffis ignored. IfNone(the default), the radius is calculated based on the size of thelabeland thebuff.buff (float)
kwargs (Any)
Examples
Example: SeveralLabeledDots ¶
from manim import * class SeveralLabeledDots(Scene): def construct(self): sq = Square(fill_color=RED, fill_opacity=1) self.add(sq) dot1 = LabeledDot(Tex("42", color=RED)) dot2 = LabeledDot(MathTex("a", color=GREEN)) dot3 = LabeledDot(Text("ii", color=BLUE)) dot4 = LabeledDot("3") dot1.next_to(sq, UL) dot2.next_to(sq, UR) dot3.next_to(sq, DL) dot4.next_to(sq, DR) self.add(dot1, dot2, dot3, dot4)
class SeveralLabeledDots(Scene): def construct(self): sq = Square(fill_color=RED, fill_opacity=1) self.add(sq) dot1 = LabeledDot(Tex("42", color=RED)) dot2 = LabeledDot(MathTex("a", color=GREEN)) dot3 = LabeledDot(Text("ii", color=BLUE)) dot4 = LabeledDot("3") dot1.next_to(sq, UL) dot2.next_to(sq, UR) dot3.next_to(sq, DL) dot4.next_to(sq, DR) self.add(dot1, dot2, dot3, dot4)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__(label, radius=None, buff=0.1, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
label (str | SingleStringMathTex | Text | Tex)
radius (float | None)
buff (float)
kwargs (Any)
- Return type:
None