gale.ui.progress_bar module

This file contains the implementation of the class ProgressBar: a filled bar showing value out of max_value, both plain public attributes so gale.timer.Timer.tween can animate them directly.

Author: Alejandro Mujica (aledrums@gmail.com)

class gale.ui.progress_bar.ProgressBar(x, y, width, height, value=0, max_value=100, color=None, theme=None)[source]

Bases: Widget

A filled bar showing value out of max_value. value and max_value are plain public attributes (no set_value/set_max methods) so they can be driven directly by gale.timer.Timer.tween, e.g.:

Timer.tween(0.5, [(health_bar, {“value”: new_hp})])

Parameters:
  • x (float)

  • y (float)

  • width (float)

  • height (float)

  • value (float)

  • max_value (float)

  • color (Color | None)

  • theme (Theme | None)

render(surface)[source]
Parameters:

surface (Surface)

Return type:

None