@@ -395,15 +395,15 @@ def construct(self):
395
395
def always (self ) -> Self :
396
396
"""Call a method on a mobject every frame.
397
397
398
- This is syntactic sugar for ``mob.add_updater(lambda m: m.method())``
398
+ This is syntactic sugar for ``mob.add_updater(lambda m: m.method(*args, **kwargs), call_updater=True)``.
399
+ Note that this will call the method immediately. If this behavior is not
400
+ desired, you should use :meth:`add_updater` directly.
399
401
400
402
.. warning::
401
403
402
- Attempting to add multiple updaters to the same mobject (such as
403
- by calling this method more than once, and not removing the previous updater)
404
- can have unintended side effects, such as one updater taking priority over the
405
- other.
406
-
404
+ Chaining of methods is allowed, but each method will be added
405
+ as its own updater. If you are chaining methods, make sure they
406
+ do not interfere with each other or you may get unexpected results.
407
407
408
408
Example
409
409
-------
@@ -413,12 +413,12 @@ def always(self) -> Self:
413
413
class AlwaysExample(Scene):
414
414
def construct(self):
415
415
sq = Square().to_edge(LEFT)
416
- t = Text("Hello World!").always.next_to(sq, UP)
416
+ t = Text("Hello World!")
417
+ t.always.next_to(sq, UP)
417
418
self.add(sq, t)
418
419
self.play(sq.animate.to_edge(RIGHT))
419
-
420
420
"""
421
- # can't use typing.cast because Self is under typing_extensions
421
+ # can't use typing.cast because Self is under TYPE_CHECKING
422
422
return _UpdaterBuilder (self ) # type: ignore
423
423
424
424
def __deepcopy__ (self , clone_from_id ) -> Self :
0 commit comments