[47] add_updater
def moving_dot(self): x_axis = NumberLine(x_min=-5, x_max=5) dot = Dot(color=RED, radius=0.15).move_to(x_axis.get_left()) number = DecimalNumber(-5, color=RED).next_to(dot, UP) number.add_updater(lambda m: m.next_to(dot, UP)) number.add_updater(lambda m: m.set_value(dot.get_center()[0])) self.add(x_axis, dot, number) self.play(dot.shift, RIGHT * 10, rate_func=there_and_back, run_time=10) self.wa..
[45]Special Effects
def broadcast(self): text = VGroup( TextMobject("Monday"), TextMobject("Tuesday"), TextMobject("Wednesday"), TextMobject("Thursday"), TextMobject("Friday"), ).arrange(DOWN) dot = Dot(color=RED).move_to(2 * RIGHT) self.add(dot) def get_broadcast(): return Broadcast(dot, big_radius=5, color=RED, run_time=5) self.play( LaggedStartMap(FadeIn, text, run_time=4, lag_ratio=0.7), Succession(*[ get_broad..