from manim import *
class ArrowTipShapes(Scene):
    """3.2 tip_shape 决定箭头尖端的形状。
    Manim CE 内置 7 种：圆 / 方 / 三角各有实心与空心，另有 StealthTip。
    直接传「类」而不是实例，Arrow 内部会负责实例化。
    """
    def construct(self):
        title = Text("箭头的样式 tip_shape", font="STLiti", font_size=34).to_edge(UP)
        self.play(Write(title), run_time=0.8)
        shapes = [
            (ArrowCircleFilledTip, "实心圆头"),
            (ArrowCircleTip, "空心圆头"),
            (ArrowSquareFilledTip, "实心方头"),
            (ArrowSquareTip, "空心方头"),
            (ArrowTriangleFilledTip, "实心三角"),
            (ArrowTriangleTip, "空心三角（默认）"),
            (StealthTip, "隐形式 Stealth"),
        ]
        rows = VGroup()
        for tip, name in shapes:
            arrow = Arrow(2.2 * LEFT, 2.2 * RIGHT,
                          tip_shape=tip, stroke_width=5)
            label = Text(name, font="STLiti", font_size=24)
            rows.add(VGroup(arrow, label).arrange(RIGHT, buff=0.5))
        rows.arrange(DOWN, buff=0.28).scale(0.85).shift(DOWN * 0.25)
        self.play(LaggedStart(*[FadeIn(r) for r in rows], lag_ratio=0.22),
                  run_time=2.8)
        self.wait(2.0)
