diff --git a/pygame_gui/elements/ui_progress_bar.py b/pygame_gui/elements/ui_progress_bar.py index 10d66af8..d2a8bdd9 100644 --- a/pygame_gui/elements/ui_progress_bar.py +++ b/pygame_gui/elements/ui_progress_bar.py @@ -47,6 +47,11 @@ def __init__(self, @property def progress_percentage(self): + """ + Get the current percentage progress of the bar from 0.0 to 1.0 + + :return: a float from 0.0 to 1.0 + """ return self.current_progress / self.maximum_progress def status_text(self): @@ -54,6 +59,11 @@ def status_text(self): return f"{self.current_progress:0.1f}/{self.maximum_progress:0.1f}" def set_current_progress(self, progress: float): + """ + Set the current percentage progress of the bar + + :param progress: a float from 0.0 to 100.0 + """ # Now that we subclass UIStatusBar, set_current_progress() and self.current_progress are mostly here for backward compatibility. self.current_progress = progress