from manim import *
import numpy as np
def head(cn, en):
    t = Text(cn, font="STLiti", font_size=28).to_edge(UP)
    s = Text(en, font="Consolas", font_size=21, color=YELLOW).next_to(t, DOWN, buff=0.10)
    return VGroup(t, s)
def foot(cn):
    return Text(cn, font="STLiti", font_size=20, color=YELLOW).to_edge(DOWN)
class ShapeDemo(Scene):
    def construct(self):
        self.add(head("基础图形：带箭头的线", "Arrow"))
        shape = Arrow(LEFT * 3 + DOWN, RIGHT * 3 + UP, color=BLUE, buff=0)
        self.play(Create(shape), run_time=2.2)
        self.play(shape.animate.set_stroke(YELLOW, width=7), run_time=1.2)
        self.play(FadeIn(foot("Arrow 在线段末端自动加上箭头")), run_time=0.4)
        self.wait(2.2)
