标签

完整名称: manim.mobject.geometry.labeled.Label

class Label(label, label_config=None, box_config=None, frame_config=None, **kwargs)[源代码]

基类: VGroup

一个由文本和边框组成的标签。

参数:
  • label (str | Tex | MathTex | Text) – 将显示的标签。

  • label_config (dict[str, Any] | None) – 包含标签配置的字典。仅当 labelstr 类型时应用。

  • box_config (dict[str, Any] | None) – 一个包含背景框配置的字典。

  • frame_config (dict[str, Any] | None) – 包含边框配置的字典。

  • kwargs (Any)

示例

示例: LabelExample

../_images/LabelExample-1.png
from manim import *

class LabelExample(Scene):
    def construct(self):
        label = Label(
            label=Text('Label Text', font='sans-serif'),
            box_config = {
                "color" : BLUE,
                "fill_opacity" : 0.75
            }
        )
        label.scale(3)
        self.add(label)
class LabelExample(Scene):
    def construct(self):
        label = Label(
            label=Text('Label Text', font='sans-serif'),
            box_config = {
                "color" : BLUE,
                "fill_opacity" : 0.75
            }
        )
        label.scale(3)
        self.add(label)

方法

属性

animate (动画)

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

animation_overrides (动画覆盖)

颜色

depth (深度)

mobject 的深度。

fill_color (填充颜色)

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

height (高度)

mobject 的高度。

n_points_per_curve (每条曲线的点数)

sheen_factor (光泽因子)

stroke_color (描边颜色)

width (宽度)

mobject 的宽度。

_original__init__(label, label_config=None, box_config=None, frame_config=None, **kwargs)

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

参数:
  • label (str | Tex | MathTex | Text)

  • label_config (dict[str, Any] | None)

  • box_config (dict[str, Any] | None)

  • frame_config (dict[str, Any] | None)

  • kwargs (Any)

返回类型: