p.g.FadingContainer(Container) : class documentation

Part of planes.gui View In Hierarchy

Known subclasses: planes.gui.tmb.TMBFadingContainer

A Container that, once visible, will fade out and destroy itself.

Additional attributes:

FadingContainer.display_duration
    The number of calls to update() that the FadingContainer will be
    displayed. Will be decremented in FadingContainer.update().

FadingContainer.alpha_steps
    A list of decreasing alpha values to be applied to the
    Surface of the FadingContainer, computed from fade_duration
    in FadingContainer.__init__().
Method __init__ Initialise.
Method update Call Plane.update(), then decrement FadingContainer.display_duration and destroy when len(self.alpha_steps) has reached zero.
Method render Call Plane.render(), the pop the first value from self.alpha_steps and apply it as alpha.

Inherited from Container:

Method redraw Redraw Container.image from the dimensions in Containter.rect. This also creates a new Container.rendersurface.
Method sub Resize the container, update the position of plane and add it as a subplane.
Method remove Remove the subplane, then reposition remaining subplanes and resize the container.
Method remove_all Remove all subplanes and shrink accordingly.

Inherited from Plane (via Container):

Method __getattr__ Access subplanes as attributes.
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, display_duration, fade_duration, padding=0, background_color=None):
Initialise.

display_duration is the number of calls to update() that the
FadingContainer will be displayed.

fade_duration is the number of calls to update() that the
FadingContainer will take to fade out.
def update(self):
Call Plane.update(), then decrement FadingContainer.display_duration and destroy when len(self.alpha_steps) has reached zero.
        
def render(self, displayrect=None):
Call Plane.render(), the pop the first value from self.alpha_steps and apply it as alpha.
        
API Documentation for planes, generated by pydoctor at 2013-03-05 14:16:20.