i'm new in renpy and trying to do my daytime screen. It works fine but i don't know ho to update the screen properly if i click on it.
if i click on my work the time go ahead by 1 hour but the period don't change properly and the function for set > 23 = 00 don't trigger.
i post my codes.
and in script.pry
pls help me...
if i click on my work the time go ahead by 1 hour but the period don't change properly and the function for set > 23 = 00 don't trigger.
i post my codes.
Code:
screen daytime:
hbox:
xalign 0.0 yalign 0.0
textbutton "[todays]"
textbutton "[time]:00 - [nowfase]":
action SetVariable("time", time + 1)
RestartStatement()
Code:
init:
$ day = 0
$ todays = "Tue"
$ daynames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
$ todays = daynames[(day%7)]
$ time = 12
if time > 23:
$time = 00
$day += 1
$ fasetime = ["Late Night", "Morning", "Afternoon", "Evening", "Night"]
$ nowtime = (time + 1)
$ nowfase = fasetime[(nowtime / 6)]