Python Manim教程大全之 01 动态显示文本(教程含源码)
2023-09-11 14:18:32 时间
实战需求
Python Manim教程大全之 01 动态显示文本
本文价值与收获
看完本文后,您将能够作出下面的界面
实战代码
from manim import *
class displayText(Scene):
def construct(self):
# Create Text objects
first_line = Text('使用Manim创建超酷动画视频')
second_line = Text('动态显示文本')
third_line = Text('你也来试试吧.', color=RED)
# Position second line underneath first line
second_line.next_to(first_line, DOWN)
# Displaying text
self.wait(1)
self.play(Write(first_line), Write(second_line))
self.wait(1)
self.play(ReplacementTransform(first_line, third_line), FadeOut(second_line))
self.wait(2)
运行代码
生成GIF
manim displaytext.py displayText -p -ql -i
生成视频
manim displaytext.py displayText -p -ql
相关文章
- Python中的时间日期模块(time、datetime)
- python安装python-lzf包,报错lzf_module.c:3:20: fatal error: Python.h: No such file or directory
- 中途转行python?怎么学?没有基础的我30了自学Python转行靠谱吗?
- Python: issues
- gyp ERR! stack Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.
- 【Python】【PyPI】twine模块打包python项目上传pypi
- 我在 10 万篇科学论文上微调了 GPT-2, AI 有可能写技术论文吗(教程含python源码)
- 使用 PyWeb3D 的 3D 家具显示,用 Python 语法探索 three.js(教程含源码)
- Python 数据分析教程之如何使用Streamlit + PySide 构建 独立数据应用(教程含源码)
- Python Streamlit教程大全之 02 获取网络数据数据,缓存网络数据(教程含源码)
- Python 桌面程序教程之 04 持久窗口使用事件循环进行多次读取,更新窗口中的数据(教程含源码)
- Python 桌面程序教程之一次性窗口,最简单的模式(教程含源码)
- Python Streamlit 教程之使用 Python 和 Streamlit 打造令人惊叹的仪表板(教程含源码)
- Python Manim教程大全之 02 数学方程(教程含源码)
- 使用 PyWeb3D 的 3D 家具显示,用 Python 语法探索 three.js(教程含源码)
- SQL Python教程之在 Python 环境中使用 SQL进校数据查询分析聚合过滤pandsql (教程含源码和数据集)
- 【Python注意事项】如何理解python中间generator functions和yield表情