2021 最新版本
[RenPy] 纯文本查看 复制代码 init python:
import datetime
import time
class GameDate(object):
def __init__(self, date):
self.date = date
def add_minutes(self, n):
self.date += datetime.timedelta(minutes = n)
def add_hours(self, n):
self.date += datetime.timedelta(hours = n)
def add_days(self, n):
self.date += datetime.timedelta(days = n)
start_day = GameDate(datetime.datetime.strptime(
"12 19 2021 00:00:00", "%m %d %Y %H:%M:%S"))
today = GameDate(start_day.date)
label start:
show screen show_time
pause
return
screen show_time():
zorder 100
fixed:
vbox:
vbox:
text today.date.strftime("%A")
text today.date.strftime("%-d/%b")
text today.date.strftime("%H:%M")
hbox:
textbutton "add 30 minutes":
action Function(today.add_minutes, n=30)
textbutton "add 1 hours":
action Function(today.add_hours, n=1)
|