Part of planes.gui View In Hierarchy
A horizontal progress bar, filling from left to right. Additional attributes: ProgressBar.percent An integer 0..100. ProgressBar.text text is a string to be rendered on top of the bar. Initially an empty string. ProgressBar.label A Label instance displaying ProgressBar.text. ProgressBar.color color is a tuple (R, G, B) giving the color of the bar. ProgressBar.background_color background_color is a tuple (R, G, B) giving the background color of the bar.
Method | __init__ | Initialise. |
Method | update | Update ProgressBar.label.text to ProgressBar.text, redraw, then call the base class method. |
Method | redraw | Update ProgressBar.image to reflect ProgressBar.percent. |
Inherited from Plane:
Method | sub | Remove the Plane given from its current parent and add it as a subplane of this Plane. |
Method | remove | Remove subplane by name or Plane instance. |
Method | remove_all | Convenience method to call Plane.remove() for all subplanes. |
Method | __getattr__ | Access subplanes as attributes. |
Method | render | Draw a composite surface of this plane and all subplanes, in order of their addition. |
Method | get_plane_at | Return the (sub)plane and the succeeding parent coordinates at the given coordinates. Subplanes are tested in reverse order of their addition (i.e. latest first). |
Method | clicked | Called when there is a MOUSEDOWN event on this plane. If click callbacks are set, the appropriate one is called with this Plane as argument. |
Method | dropped_upon | If a plane is dropped on top of this one, call dropped_upon_callback() and conditionally grab it. |
Method | destroy | Remove this Plane from the parent plane, remove all subplanes and delete all pygame Surfaces. |
Method | sync | Save the Plane given as master Plane and the position offset to that Plane for position synchronisation in Plane.update(). |
Method | unsync | Remove the position synchronisation to the sync master Plane. |
Method | mouseover_callback | Callback function when the mouse cursor moves over this plane. The default implementation sets Plan.mouseover to True when Plane.highlight is set. |
Method | mouseout_callback | Callback function when the mouse cursor has left this plane. The default implementation sets Plan.mouseover to False. |
Method | __repr__ | Readable string representation. |
Initialise. percent must be an integer 0..100. text is a string to be rendered on top of the bar. color is a tuple (R, G, B) giving the color of the bar. background_color is a tuple (R, G, B) giving the background color of the bar.
Update ProgressBar.label.text to ProgressBar.text, redraw, then call the base class method.