LabeledArrow

限定名称: manim.mobject.geometry.labeled.LabeledArrow

class LabeledArrow(*args, **kwargs)[来源]

基础类:LabeledLine, Arrow

构造一个箭头,在其长度某处包含一个标签框。 此类从LabeledLine继承其标签属性,因此控制它的主要参数是相同的。

Parameters:
  • 标签 (str | Tex | MathTex | 文本) – 将显示在行上的标签。

  • label_position (float | optional) – 一个在[0-1]范围内的比率,用于指示标签相对于线条长度的位置。默认值为0.5。

  • font_size (float | optional) – 控制标签的字体大小。此参数仅在label类型为str时使用。

  • label_color (ParsableManimColor | optional) – 标签文本的颜色。此参数仅在label类型为str时使用。

  • label_frame (Bool | optional) – 为标签框添加一个SurroundingRectangle框架。

  • frame_fill_color (ParsableManimColor | optional) – 用于填充标签框的背景颜色。如果未提供值,将使用画布的背景颜色。

  • frame_fill_opacity (float | optional) – 通过传递一个在[0-1]范围内的值来确定标签框的不透明度,其中0表示完全透明,1表示完全不透明。

另请参阅

LabeledLine

示例

示例:LabeledArrowExample

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

class LabeledArrowExample(Scene):
    def construct(self):
        l_arrow = LabeledArrow("0.5", start=LEFT*3, end=RIGHT*3 + UP*2, label_position=0.5)

        self.add(l_arrow)
class LabeledArrowExample(Scene):
    def construct(self):
        l_arrow = LabeledArrow("0.5", start=LEFT*3, end=RIGHT*3 + UP*2, label_position=0.5)

        self.add(l_arrow)

方法

属性

animate

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

animation_overrides

color

depth

mobject的深度。

fill_color

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

height

mobject的高度。

n_points_per_curve

sheen_factor

stroke_color

width

mobject的宽度。

_original__init__(*args, **kwargs)

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

Return type: