p.g.Label(planes.Plane) : class documentation

Part of planes.gui View In Hierarchy

Known subclasses: planes.gui.Button, planes.gui.Option, planes.gui.OutlinedText, planes.gui.TextBox

A planes.Plane which displays a text.

Additional attributes:

Label.text
    The text to be written on the Label

Label.cached_text
    Cache to catch changes

Label.background_color
    The original background color for this Label

Label.current_color
    The current background color

Label.cached_color
    A cache for color changes

Label.text_color
    The text color, initially (0, 0, 0).

Label.font
    The PyGame.font.Font instante used for this Label.
Method __init__ Initialise the Label. text is the text to be written on the Label. If text is None, it is replaced by an empty string.
Method update Renew the text on the label, then call the base class method.
Method redraw Redraw the Label if necessary.

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.
def __init__(self, name, text, rect, background_color=None, text_color=(0, 0, 0), font=FONTS.small_font):
Initialise the Label.
text is the text to be written on the Label. If text is None, it is
replaced by an empty string.
def update(self):
overridden in planes.gui.Button
Renew the text on the label, then call the base class method.
        
def redraw(self):
Redraw the Label if necessary.
        
API Documentation for planes, generated by pydoctor at 2013-03-05 14:16:20.