from manim import *
import numpy as np
def head(cn, en):
    t = Text(cn, font="STLiti", font_size=27).to_edge(UP)
    s = Text(en, font="Consolas", font_size=20, 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 NumberLineTip(Scene):
    def construct(self):
        self.add(head("NumberLine：箭头与端点样式", "include_tip / tip_shape"))
        l1 = NumberLine(x_range=[-5, 6, 1], include_tip=True,
                        tip_width=0.15, tip_height=0.15).shift(UP * 1.5)
        l2 = NumberLine(x_range=[-5, 6, 1], include_tip=True,
                        tip_shape=ArrowCircleTip).shift(DOWN * 1.5)
        l1.add_numbers(font_size=22)
        l2.add_numbers(font_size=22)
        self.add(Text("默认三角箭头", font="STLiti", font_size=19, color=GREY_A).next_to(l1, UP))
        self.add(Text("ArrowCircleTip", font="Consolas", font_size=19, color=GREY_A).next_to(l2, UP))
        self.play(Create(l1), run_time=2.0)
        self.play(Create(l2), run_time=2.0)
        self.play(FadeIn(foot("tip_shape 可换成任意 ArrowTip 子类")), run_time=0.4)
        self.wait(1.6)
