本文整理汇总了Python中scene.Scene.play方法的典型用法代码示例。如果您正苦于以下问题:Python Scene.play方法的具体用法?Python Scene.play怎么用?Python Scene.play使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scene.Scene
的用法示例。
在下文中一共展示了Scene.play方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: play
# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import play [as 别名]
def play(self, *args, **kwargs):
if not self.has_started:
self.has_started = True
everything = Mobject(*self.mobjects)
vect = 2*SPACE_WIDTH*RIGHT
everything.shift(vect)
self.play(ApplyMethod(
everything.shift, -vect,
rate_func = rush_from
))
Scene.play(self, *args, **kwargs)
示例2: play
# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import play [as 别名]
def play(self, *args, **kwargs):
if self.pi_creature not in self.get_mobjects():
Scene.play(self, *args, **kwargs)
return
if inspect.ismethod(args[0]):
mobject_of_interest = args[0].im_self
elif isinstance(args[0], Transform):
if args[0].mobject is self.pi_creature:
mobject_of_interest = self.pi_creature
else:
mobject_of_interest = args[0].ending_mobject
elif isinstance(args[0], Animation):
mobject_of_interest = args[0].mobject
else:
raise Exception("Invalid play args")
if mobject_of_interest is self.pi_creature:
new_anims = []
else:
new_anims = [self.pi_creature.look_at, mobject_of_interest]
Scene.play(self, *list(args) + new_anims, **kwargs)
示例3: play
# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import play [as 别名]
def play(self, *animations, **kwargs):
Scene.play(
self,
*list(animations)+map(Animation, self.foreground_mobjects),
**kwargs
)