Numbers

ChangingDecimal

class manimlib.animation.numbers.ChangingDecimal(decimal_mob, number_update_func, **kwargs)
ChangingDecimalExample
class ChangingDecimalExample(Scene):
    def construct(self):
        number = DecimalNumber(0).scale(2)
        def update_func(t):
            return t * 10
        self.add(number)
        self.wait()
        self.play(ChangingDecimal(number, update_func), run_time=3)
        self.wait()

ChangeDecimalToValue

class manimlib.animation.numbers.ChangeDecimalToValue(decimal_mob, target_number, **kwargs)

从当前数字播放到目标数字

ChangeDecimalToValueExample
class ChangeDecimalToValueExample(Scene):
    def construct(self):
        number = DecimalNumber(0).scale(2)
        self.add(number)
        self.wait()
        self.play(ChangeDecimalToValue(number, 20), run_time=3)
        self.wait()

CountInFrom

class manimlib.animation.numbers.CountInFrom(decimal_mob, source_number=0, **kwargs)

从 source_number 开始播放到当前数字