From ceecbdb76a1c72bb9d7605429d4862c3b08d0b21 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 11 Dec 2024 16:46:58 +0000 Subject: [PATCH] Tried to improve a comment, and also added a default frame rate of 25 FPS for pause() --- public/public_libraries/strype/graphics.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/public_libraries/strype/graphics.py b/public/public_libraries/strype/graphics.py index d8e5576e..921cb1ec 100644 --- a/public/public_libraries/strype/graphics.py +++ b/public/public_libraries/strype/graphics.py @@ -854,10 +854,9 @@ def stop(): _last_frame = _time.time() -def pause(actions_per_second): +def pause(actions_per_second = 25): """ - Waits for a suitable amount of time since the last call to pause() to allow you to take - the given number of actions per second. This is almost always used like follows: + Waits for a suitable amount of time since the last call to pause(). This is almost always used as follows: ``` while True: @@ -869,6 +868,8 @@ def pause(actions_per_second): for 1/30th of a second, but it accounts for the fact that your actions may have taken some time, so it aims to keep you executing the actions 30 times per second (or whatever value you pass for actions_per_second). + + :param actions_per_second: The amount of times you want to call pause() per second, 25 by default. """ global _last_frame now = _time.time()