Skip to content

Commit

Permalink
Change UpdatersExample scene to feature .always and .f_always syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
3b1b committed Mar 7, 2024
1 parent d3ba101 commit 226d649
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions example_scenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def construct(self):

# This ensures that the method deicmal.next_to(square)
# 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
# label.add_updater(lambda m: m.next_to(brace, UP))

Expand All @@ -302,7 +302,7 @@ def construct(self):
# should be functions returning arguments to that method.
# The following line ensures thst decimal.set_value(square.get_y())
# 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
# number.add_updater(lambda m: m.set_value(square.get_width()))

Expand Down

0 comments on commit 226d649

Please sign in to comment.