当前位置: 首页>>代码示例>>Python>>正文


Python Scene.play方法代码示例

本文整理汇总了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)
开发者ID:PythonJedi,项目名称:manim,代码行数:13,代码来源:light.py

示例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)
开发者ID:aquafemi,项目名称:manim,代码行数:24,代码来源:characters.py

示例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
     )
开发者ID:crclayton,项目名称:manim,代码行数:8,代码来源:complex_numbers.py


注:本文中的scene.Scene.play方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。