本文整理汇总了Python中mobject.tex_mobject.TextMobject.rotate方法的典型用法代码示例。如果您正苦于以下问题:Python TextMobject.rotate方法的具体用法?Python TextMobject.rotate怎么用?Python TextMobject.rotate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mobject.tex_mobject.TextMobject
的用法示例。
在下文中一共展示了TextMobject.rotate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: construct
# 需要导入模块: from mobject.tex_mobject import TextMobject [as 别名]
# 或者: from mobject.tex_mobject.TextMobject import rotate [as 别名]
def construct(self):
glass = Region(lambda x, y : y < 0, color = BLUE_E)
self.generate_start_and_end_points()
straight = Line(self.start_point, self.end_point)
slow = TextMobject("Slow")
slow.rotate(np.arctan(straight.get_slope()))
slow.shift(straight.points[int(0.7*straight.get_num_points())])
slow.shift(0.5*DOWN)
too_long = TextMobject("Too long")
too_long.shift(UP)
air = TextMobject("Air").shift(2*UP)
water = TextMobject("Water").shift(2*DOWN)
self.add(glass)
self.play(GrowFromCenter(air))
self.play(GrowFromCenter(water))
self.dither()
self.remove(air, water)
ShowMultiplePathsScene.construct(self)
self.play(
Transform(self.path, straight)
)
self.dither()
self.play(GrowFromCenter(slow))
self.dither()
self.remove(slow)
self.leftmost.ingest_submobjects()
self.play(Transform(self.path, self.leftmost, run_time = 3))
self.dither()
self.play(ShimmerIn(too_long))
self.dither()