.. Automatically generated file - do not modify.

.. function:: ConditionSwitch(*args, **kwargs)
    
    This is a displayable that changes what it is showing based on
    python conditions. The positional argument should be given in
    groups of two, where each group consists of:
    
    * A string containing a python condition.
    * A displayable to use if the condition is true.
    
    The first true condition has its displayable shown, at least
    one condition should always be true.
    
    ::
    
        image jill = ConditionSwitch(
            "jill_beers > 4", "jill_drunk.png",
            "True", "jill_sober.png")

.. function:: DynamicDisplayable(function, *args, **kwargs)
    
    A displayable that can change its child based on a Python
    function, over the course of an interaction.
    
    `function`
        A function that is called with the arguments:
    
        * The amount of time the displayable has been shown for.
        * The amount of time any displayable with the same tag has been shown for.
        * Any positional or keyword arguments supplied to DynamicDisplayable.
    
        and should return a (d, redraw) tuple, where:
    
        * `d` is a displayable to show.
        * `redraw` is the amount of time to wait before calling the
          function again, or None to not call the function again
          before the start of the next interaction.
    
        `function` is called at the start of every interaction.
    
    As a special case, `function` may also be a python string that evaluates
    to a displayable. In that case, function is run once per interaction.
    
    ::
    
        # Shows a countdown from 5 to 0, updating it every tenth of
        # a second until the time expires.
        init python:
    
            def show_countdown(st, at):
                if st > 5.0:
                    return Text("0.0"), None
                else:
                    d = Text("{:.1f}".format(5.0 - st))
                    return d, 0.1
    
        image countdown = DynamicDisplayable(show_countdown)

.. function:: ShowingSwitch(*args, **kwargs)
    
    This is a displayable that changes what it is showing based on the
    images are showing on the screen. The positional argument should
    be given in groups of two, where each group consists of:
    
    * A string giving an image name, or None to indicate the default.
    * A displayable to use if the condition is true.
    
    A default image should be specified.
    
    One use of ShowingSwitch is to have side images change depending on
    the current emotion of a character. For example::
    
       define e = Character("Eileen",
           show_side_image=ShowingSwitch(
               "eileen happy", Image("eileen_happy_side.png", xalign=1.0, yalign=1.0),
               "eileen vhappy", Image("eileen_vhappy_side.png", xalign=1.0, yalign=1.0),
               None, Image("eileen_happy_default.png", xalign=1.0, yalign=1.0),
               )
           )

