from manim import * from datetime import datetime classDemo(Scene): defconstruct(self): t = Title("how to learn manim?") now = datetime.now().strftime("%H:%M:%S") t = Title("now: ", now) _obj = t self.play(FadeIn(_obj), run_time=1.0) self.wait(3.00) self.wait(1.60)
标题中带公式
除了文字和变量,标题中也可以带有数学公式。
1 2 3 4 5 6 7 8 9
from manim import * classDemo(Scene): defconstruct(self): t = Title("x2+y2=z2") t = Title("\int_a^b f'(x) dx = f(b)- f(a)") _obj = t self.play(FadeIn(_obj), run_time=1.0) self.wait(3.00) self.wait(1.60)
标题和线
Title类中除了text_parts参数之外,其他几个参数都是用来调节文字和下划线之间的关系的。
1 2 3 4 5 6 7 8 9 10 11
from manim import * classDemo(Scene): defconstruct(self): t = Title("without underline", include_underline=False) t = Title("short title", match_underline_width_to_text=True) t = Title("longlonglonglong title", match_underline_width_to_text=True) t = Title("large buffer from underline", underline_buff=1) _obj = t self.play(FadeIn(_obj), run_time=1.0) self.wait(3.00) self.wait(1.60)
附件
数学动画引擎
记录生活、理财与折腾
主观感受,仅供参考。本文采用 本文采用 CC BY-NC-SA 4.0 许可 协议,
完整转载请注明来自 数学动画引擎。