How to use the manimlib.animation.creation.Write function in manimlib

To help you get started, we’ve selected a few manimlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Solara570 / demo-solara / calissons.py View on Github external
def show_counter(self):
        counters = VGroup(*[rhombus.get_counter_tex() for rhombus in self.rhombi])
        three_types_text = self.bg_texts[2]
        try_tiling_text, remark = self.bg_texts[3]
        self.play(
            FadeOut(self.reflines),
            ApplyMethod(self.rhombi.set_fill, None, 1),
            Write(three_types_text),
            run_time = 2
        )
        self.wait()
        self.play(Write(try_tiling_text), run_time = 2)
        self.play(Write(remark), run_time = 1)
        self.wait()
        self.play(FadeIn(counters), run_time = 1)
        self.wait(4)
        self.counters = counters
github 3b1b / manim / manimlib / scene / vector_space_scene.py View on Github external
)
        y_coord_start = self.position_y_coordinate(
            y_coord.copy(), y_line, vector
        )
        brackets = array.get_brackets()

        if show_creation:
            self.play(ShowCreation(arrow))
        self.play(
            ShowCreation(x_line),
            Write(x_coord_start),
            run_time=1
        )
        self.play(
            ShowCreation(y_line),
            Write(y_coord_start),
            run_time=1
        )
        self.wait()
        self.play(
            Transform(x_coord_start, x_coord, lag_ratio=0),
            Transform(y_coord_start, y_coord, lag_ratio=0),
            Write(brackets, run_time=1),
        )
        self.wait()

        self.remove(x_coord_start, y_coord_start, brackets)
        self.add(array)
        if clean_up:
            self.clear()
            self.add(*starting_mobjects)
        return array, x_line, y_line
github Solara570 / demo-solara / calissons.py View on Github external
def proof_part_1(self):
        proof_text, paint_text, and_text, perspective_text = self.proof_texts
        self.play(Write(proof_text), run_time = 1)
        self.wait(4)
        self.play(Write(paint_text), run_time = 1)
        self.wait(3)
        self.play(FadeIn(self.imagine_3d_text), run_time = 1)
        self.wait(6)
        self.play(FadeOut(self.imagine_3d_text), run_time = 1)
        self.wait()
        self.play(Write(VGroup(and_text, perspective_text), run_time = 1))
        self.wait()
github Solara570 / demo-solara / calissons.py View on Github external
def setup_tiling(self):
        self.wait(2)
        self.set_camera_orientation(*DIAG_POS)
        self.tiling = CalissonTiling3D(dimension = 5, pattern = MAA_PATTERN)
        self.play(Write(self.tiling, rate_func = smooth), run_time = 3)
        self.wait(2)
github Solara570 / demo-solara / short / kkd / kkd.py View on Github external
lhs.set_color(GREEN)
        rhs.set_color(BLUE)

        prod_tex_rect = SurroundingRectangle(self.prod_tex, color = GREEN)
        sum_tex_rect = SurroundingRectangle(self.sum_tex, color = BLUE)
        self.play(
            ShowCreationThenDestruction(prod_tex_rect),
            Write(lhs),
            run_time = 2,
        )
        self.play(
            ShowCreationThenDestruction(sum_tex_rect),
            Write(rhs),
            run_time = 2,
        )
        self.play(Write(equal))
        self.wait(3)
github Solara570 / demo-solara / short / kkd / kkd.py View on Github external
Write(self.get_plus_symbol(n-1)),
                    )
                self.wait()
            # And show the result for the remaining terms
            else:
                self.play(
                    Transform(
                        VGroup(
                            self.get_highlighted_terms(n).deepcopy(),
                            self.get_times_symbols().deepcopy(),
                            self.get_cdots_symbol().deepcopy(),
                        ),
                        self.get_sum_term(n),
                        lag_ratio = 0,
                    ),
                    Write(self.get_plus_symbol(n-1)),
                )
        # Add \cdots to the end.
        self.wait()
        self.play(
            FadeOut(rects),
            Write(self.sum_tex[-1][-4:])
        )
        self.wait()
github Solara570 / demo-solara / calissons.py View on Github external
def ask_about_how_to_prove(self):
        claim_text = self.q_texts[0]
        self.wait()
        self.play(self.q_texts.shift, DOWN, run_time = 1)
        claim_rect = SurroundingRectangle(
            VGroup(claim_text, self.how_to_prove_text),
            stroke_color = YELLOW, buff = 0.3
        )
        self.play(
            Write(self.how_to_prove_text),
            ShowCreation(claim_rect),
            run_time = 1,
        )
        self.wait()
        self.claim_rect = claim_rect
github Solara570 / demo-solara / calissons.py View on Github external
def show_claim(self):
        self.play(FadeOut(self.bg_texts), run_time = 2)
        self.wait()
        claim_text = self.q_texts[0]
        self.play(Write(claim_text), run_time = 2)
        self.wait(2)
github Solara570 / demo-solara / calissons.py View on Github external
def show_rhombi(self):
        self.wait()
        rhombi = VGroup(*[RhombusType() for RhombusType in (RRhombus, HRhombus, LRhombus)])
        rhombi.arrange_submobjects(RIGHT, aligned_edge = DOWN, buff = 1)
        rhombi.to_edge(RIGHT, buff = 1)
        rhombi.to_edge(UP)
        hexagon_text, rhombi_text = self.bg_texts[0]
        self.play(
            Write(hexagon_text),
            run_time = 1
        )
        self.wait()
        self.play(
            ShowCreation(rhombi, submobject_mode = "all_at_once"),
            Write(rhombi_text),
            run_time = 1
        )
        self.wait()
        self.rhombi = rhombi
github 3b1b / manim / manimlib / scene / scene.py View on Github external
def tex(self, latex):
        eq = TextMobject(latex)
        anims = []
        anims.append(Write(eq))
        for mobject in self.mobjects:
            anims.append(ApplyMethod(mobject.shift, 2 * UP))
        self.play(*anims)