Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions example_scenes/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,43 @@ def construct(self):
)
)
self.wait()


class WriteStuff(Scene):
def construct(self):
example_text = Tex("This is a some text", tex_to_color_map={"text": YELLOW})
example_tex = MathTex(
"\\sum_{k=1}^\\infty {1 \\over k^2} = {\\pi^2 \\over 6}",
)
group = VGroup(example_text, example_tex)
group.arrange(DOWN)
group.set_width(config["frame_width"] - 2 * LARGE_BUFF)

self.play(Write(example_text))
self.play(Write(example_tex))
self.wait()


class UpdatersExample(Scene):
def construct(self):
decimal = DecimalNumber(
0,
show_ellipsis=True,
num_decimal_places=3,
include_sign=True,
)
square = Square().to_edge(UP)

decimal.add_updater(lambda d: d.next_to(square, RIGHT))
decimal.add_updater(lambda d: d.set_value(square.get_center()[1]))
self.add(square, decimal)
self.play(
square.to_edge,
DOWN,
rate_func=there_and_back,
run_time=5,
)
self.wait()


# See many more examples at https://manimce.readthedocs.io/en/latest/examples.html