LabeledDot

全称: manim.mobject.geometry.arc.LabeledDot

class LabeledDot(label, radius=None, **kwargs)[source]

基类: Dot

一个中心包含标签的Dot

参数:
  • label (str | SingleStringMathTex | Text | Tex) – Dot的标签。默认情况下(即传入str时),此标签会渲染为MathTex,但也可以传入其他表示渲染字符串的类,例如TextTex

  • radius (float | None) – Dot的半径。如果为None(默认值),则半径会根据label的大小计算。

  • kwargs (Any)

示例

示例: SeveralLabeledDots

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

方法

属性

animate (动画)

用于动画化 self 的任何方法的应用。

animation_overrides (动画覆盖)

颜色

depth (深度)

mobject 的深度。

fill_color (填充颜色)

如果存在多种颜色(用于渐变),则返回第一种颜色

height (高度)

mobject 的高度。

n_points_per_curve (每条曲线的点数)

sheen_factor (光泽因子)

stroke_color (描边颜色)

width (宽度)

mobject 的宽度。

_original__init__(label, radius=None, **kwargs)

初始化自身。有关准确签名,请参阅 help(type(self))。

参数:
返回类型: