Plays a "no operation" animation. Parameters ---------- duration The run time of the animation. stop_condition A function without positional arguments that is evaluated every time a frame is rendered. The animation only stops when
(
self,
duration: float = DEFAULT_WAIT_TIME,
stop_condition: Callable[[], bool] | None = None,
frozen_frame: bool | None = None,
)
| 1207 | ) |
| 1208 | |
| 1209 | def wait( |
| 1210 | self, |
| 1211 | duration: float = DEFAULT_WAIT_TIME, |
| 1212 | stop_condition: Callable[[], bool] | None = None, |
| 1213 | frozen_frame: bool | None = None, |
| 1214 | ) -> None: |
| 1215 | """Plays a "no operation" animation. |
| 1216 | |
| 1217 | Parameters |
| 1218 | ---------- |
| 1219 | duration |
| 1220 | The run time of the animation. |
| 1221 | stop_condition |
| 1222 | A function without positional arguments that is evaluated every time |
| 1223 | a frame is rendered. The animation only stops when the return value |
| 1224 | of the function is truthy, or when the time specified in ``duration`` |
| 1225 | passes. |
| 1226 | frozen_frame |
| 1227 | If True, updater functions are not evaluated, and the animation outputs |
| 1228 | a frozen frame. If False, updater functions are called and frames |
| 1229 | are rendered as usual. If None (the default), the scene tries to |
| 1230 | determine whether or not the frame is frozen on its own. |
| 1231 | |
| 1232 | See also |
| 1233 | -------- |
| 1234 | :class:`.Wait`, :meth:`.should_mobjects_update` |
| 1235 | """ |
| 1236 | duration = self.validate_run_time(duration, self.wait, "duration") |
| 1237 | self.play( |
| 1238 | Wait( |
| 1239 | run_time=duration, |
| 1240 | stop_condition=stop_condition, |
| 1241 | frozen_frame=frozen_frame, |
| 1242 | ) |
| 1243 | ) |
| 1244 | |
| 1245 | def pause(self, duration: float = DEFAULT_WAIT_TIME) -> None: |
| 1246 | """Pauses the scene (i.e., displays a frozen frame). |