[015]Text: font size
t1 = Text("Hello 0.1", font='굴림', stroke_width=1, size=0.1) t2 = Text("Hello 0.2", font='굴림', stroke_width=1, size=0.2) t3 = Text("Hello 0.3", font='굴림', stroke_width=1, size=0.3) t4 = Text("Hello 0.4", font='굴림', stroke_width=1, size=0.4) t5 = Text("Hello 0.5", font='굴림', stroke_width=1, size=0.5) t6 = Text("Hello 0.7 ", font='굴림', stroke_width=1, size=0.7) t7 = Text("Hello 1", font='굴림', strok..
[014]Text/TextMobject/TexMobject
Text, TextMobject str = Text("페르마의 마지막 정리", font='바탕') text = TextMobject("방정식 $x^n + y^n = z^n$를 만족하는 $(x,y,z)$값이 존재하지 않는다") tex = TexMobject("x^n + y^n = z^n") group = VGroup(str,text, tex) group.arrange(DOWN) self.add(group) self.wait() Text: t2c t1 = Text("Hello, this is one sentence", font='굴림', size=0.5, stroke_width=1, t2c={'Hello': YELLOW, 'one': RED} ) t2 = Text("Google", font='Arial', ..
[013]Text: Transform
eq = TexMobject("a^2", "+", "b^2", "=", "c^2") eq.save_state() self.add(eq) self.play( eq[0].become,TexMobject("3^2").move_to(eq[0]), eq[2].become,TexMobject("4^2").move_to(eq[2]), eq[4].become,TexMobject("5^2").move_to(eq[4]), run_time=2, ) self.wait() eq.restore() self.add() self.play( Transform(eq[0], TexMobject("3^2").move_to(eq[0])), Transform(eq[2], TexMobject("4^2").move_to(eq[2])), Trans..
[012]TextMobject.set_color/set_color_by_map
Text Color: tex_to_color_map t1 = TexMobject( "P(A|B) = {P(A)P(B|A) \\over P(B)}", tex_to_color_map={ "A": YELLOW, "B": BLUE, }, ) self.add(t1) self.wait() Text Color: set_color_by_tex eq = TexMobject("x", "=", "L", "\\theta") eq.set_color_by_tex("\\theta", BLUE) self.add(eq) self.wait() Text Color: set_color_by_tex_to_color_map(1) all_words = VGroup( TextMobject("You have a\\\\", "hypothesis"),..
[011]Text/TextMobject
Text Class str = ["사과","배", "대추", "감", "먹고 싶다"] text = VGroup(*[Text(s, font='J신영복 Regular') for s in str]) text.arrange(DOWN) self.add(text) self.wait() TextMobject Class (1) tex = TexMobject("a^2","+", "b^2","=","c^2") self.add(tex) self.wait() self.play( tex[0].set_color, RED, tex[2].set_color, RED, tex[4].become, TexMobject("d^2").move_to(tex[4]), # Transform(tex[4], TexMobject("d^2").move_t..
[008]align_to/arrange/arrange_in_grid
align_to class AlignToTest(Scene): def construct(self): dir_str = [ 'UP', 'DOWN', 'LEFT', 'RIGHT'] dir_list = [ UP, DOWN, LEFT, RIGHT] rect = Rectangle(width=1, height=0.4) rect_tgt = Rectangle(width=3, height=2).shift(RIGHT * 3, UP * 2) self.add(rect, rect_tgt) for str, dir in zip(dir_str, dir_list): new_rect = rect.copy() obj = self.get_text_rect(str, new_rect) self.play(obj.align_to, rect_tgt..