Warning

This wiki is very out of date, and only exists for historical reasons. For more modern information, see the new documentation and cookbook forum.

renpy/doc/reference/functions/ConditionSwitch

From Ren'Py Visual Novel Engine

< renpy | doc | reference | functions(Redirected from ConditionSwitch)
Jump to: navigation, search

ConditionSwitch

Function:
ConditionSwitch (*args, **properties):

This is a wrapper around DynamicDisplayable that displays the first displayable matching a condition. It takes an even number of positional arguments, with odd arguments being strings containing python conditions, and even arguments being displayables. On each interaction, it evaluates the conditions in order to find the first that is true, and then displays that displayable. It is an error for no condition to be true.

If supplied, keyword arguments are used to position the chosen displayable.

Example

init:
    image bg waterfront = ConditionSwitch(
        "time_of_day == 'day'", "waterfront_day.jpg",
        "time_of_day == 'night'", "waterfront_night.jpg",
        )


Personal tools