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("基础图形：虚线", "DashedLine"))
        shape = DashedLine(LEFT * 3, RIGHT * 3, color=BLUE).set_stroke(width=6)
        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("DashedLine 把同一条线段拆成等距短划")), run_time=0.4)
        self.wait(2.2)
