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


Python TextMobject.to_corner方法代码示例

本文整理汇总了Python中mobject.tex_mobject.TextMobject.to_corner方法的典型用法代码示例。如果您正苦于以下问题:Python TextMobject.to_corner方法的具体用法?Python TextMobject.to_corner怎么用?Python TextMobject.to_corner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mobject.tex_mobject.TextMobject的用法示例。


在下文中一共展示了TextMobject.to_corner方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: construct

# 需要导入模块: from mobject.tex_mobject import TextMobject [as 别名]
# 或者: from mobject.tex_mobject.TextMobject import to_corner [as 别名]
    def construct(self):
        europe = ImageMobject("Europe", use_cache = False)
        self.add(europe)
        self.freeze_background()

        mathematicians = [
            ("Newton", [-1.75, -0.75, 0]),
            ("Jacob_Bernoulli",[-0.75, -1.75, 0]),
            ("Ehrenfried_von_Tschirnhaus",[0.5, -0.5, 0]),
            ("Gottfried_Wilhelm_von_Leibniz",[0.2, -1.75, 0]),
            ("Guillaume_de_L'Hopital", [-1.75, -1.25, 0]),
        ]

        for name, point in mathematicians:
            man = ImageMobject(name, invert = False)
            if name == "Newton":
                name = "Isaac_Newton"
            name_mob = TextMobject(name.replace("_", " "))
            name_mob.to_corner(UP+LEFT, buff=0.75)
            self.add(name_mob)
            man.scale_to_fit_height(4)
            mobject = Point(man.get_corner(UP+LEFT))
            self.play(Transform(mobject, man))
            man.scale(0.2)
            man.shift(point)
            self.play(Transform(mobject, man))
            self.remove(name_mob)
开发者ID:GodotMisogi,项目名称:manim,代码行数:29,代码来源:drawing_images.py

示例2: add_force_definitions

# 需要导入模块: from mobject.tex_mobject import TextMobject [as 别名]
# 或者: from mobject.tex_mobject.TextMobject import to_corner [as 别名]
 def add_force_definitions(self):
     top_force = TexMobject("F_1 = \\dfrac{1}{v_{\\text{air}}}")
     bottom_force = TexMobject("F_2 = \\dfrac{1}{v_{\\text{water}}}")
     top_spring, bottom_spring = self.start_springs.split()
     top_force.next_to(top_spring)
     bottom_force.next_to(bottom_spring, DOWN, buff = -0.5)
     words = TextMobject("""
         The force in a real spring is 
         proportional to that spring's length
     """)
     words.to_corner(UP+RIGHT)
     for force in top_force, bottom_force:
         self.play(GrowFromCenter(force))
         self.dither()
     self.play(ShimmerIn(words))
     self.dither(3)
     self.remove(top_force, bottom_force, words)
开发者ID:PythonJedi,项目名称:manim,代码行数:19,代码来源:light.py

示例3: construct

# 需要导入模块: from mobject.tex_mobject import TextMobject [as 别名]
# 或者: from mobject.tex_mobject.TextMobject import to_corner [as 别名]
    def construct(self):
        words = TextMobject(
            ["Which path ", "would \\emph{light} take", "?"]
        )
        words.split()[1].highlight(YELLOW)
        words.to_corner(UP+RIGHT)
        self.add_cycloid_end_points()

        anims = [
            self.photon_run_along_path(
                path, 
                rate_func = smooth
            )
            for path in  self.get_paths()
        ]
        self.play(anims[0], ShimmerIn(words))
        for anim in anims[1:]:
            self.play(anim)
开发者ID:PythonJedi,项目名称:manim,代码行数:20,代码来源:light.py


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