Example:
Code: Select all
image bg waterfront = ConditionSwitch(
"time_of_day == 'day'", "waterfront_day.jpg",
"time_of_day == 'night'", "waterfront_night.jpg",
)
Code: Select all
init -1 python:
cs = ConditionSwitch(
"time_of_day == 'day'", "waterfront_day.jpg",
"time_of_day == 'night'", "waterfront_night.jpg",
)
time_of_day == 'night'
renpy.image ("waterfront",cs)
Code: Select all
$ time_of_day = 'day'
scene waterfront
debug:
Open your console:
type:
Code: Select all
cs.__dict__['child'].args
Code: Select all
init -1 python:
ttime = [ 'day','night' ]
cs = tuple()
for t in ttime:
cs += ( "time_of_day == '"+t+"'","waterfront_"+t+".jpg" )
renpy.image ("waterfront",ConditionSwitch( *cs ))