from manim import *
class AnnotationDotDemo(Scene):
    """2.4 AnnotationDot 把点拆成「边框 + 内部」两层。
    stroke_width 控制边框厚度，stroke_color / fill_color 分别设边框与内部颜色。
    """
    def construct(self):
        title = Text("注释点 AnnotationDot", font="STLiti", font_size=34).to_edge(UP)
        self.play(Write(title), run_time=0.8)
        specs = [
            (2, RED, GREEN, "细边框 2"),
            (10, BLUE, YELLOW, "中边框 10"),
            (20, YELLOW, RED, "粗边框 20"),
            (40, GREEN, PURPLE, "超粗边框 40"),
        ]
        dots = VGroup(*[
            AnnotationDot(radius=0.50, stroke_width=w,
                          stroke_color=sc, fill_color=fc)
            for w, sc, fc, _ in specs
        ]).arrange(RIGHT, buff=1.2)
        labels = VGroup(*[Text(n, font="STLiti", font_size=22)
                          for _, _, _, n in specs])
        for lab, dot in zip(labels, dots):
            lab.next_to(dot, DOWN, buff=0.6)
        self.play(LaggedStart(*[FadeIn(d) for d in dots], lag_ratio=0.3),
                  run_time=2.2)
        self.play(FadeIn(labels), run_time=0.6)
        self.wait(2.4)
