mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Change UpdatersExample scene to feature .always and .f_always syntax
This commit is contained in:
parent
d3ba101ee5
commit
226d649ee6
1 changed files with 2 additions and 2 deletions
|
@ -293,7 +293,7 @@ class UpdatersExample(Scene):
|
||||||
|
|
||||||
# This ensures that the method deicmal.next_to(square)
|
# This ensures that the method deicmal.next_to(square)
|
||||||
# is called on every frame
|
# is called on every frame
|
||||||
always(label.next_to, brace, UP)
|
label.always.next_to(brace, UP)
|
||||||
# You could also write the following equivalent line
|
# You could also write the following equivalent line
|
||||||
# label.add_updater(lambda m: m.next_to(brace, UP))
|
# label.add_updater(lambda m: m.next_to(brace, UP))
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ class UpdatersExample(Scene):
|
||||||
# should be functions returning arguments to that method.
|
# should be functions returning arguments to that method.
|
||||||
# The following line ensures thst decimal.set_value(square.get_y())
|
# The following line ensures thst decimal.set_value(square.get_y())
|
||||||
# is called every frame
|
# is called every frame
|
||||||
f_always(number.set_value, square.get_width)
|
number.f_always.set_value(square.get_width)
|
||||||
# You could also write the following equivalent line
|
# You could also write the following equivalent line
|
||||||
# number.add_updater(lambda m: m.set_value(square.get_width()))
|
# number.add_updater(lambda m: m.set_value(square.get_width()))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue