- Aug 27, 2018
- 1,246
- 3,121
Need help with Renpy
I want to make a main screen with both hover buttons and variable strings including episode, day, time etc.
The string I want to include is
def display_screen_header (version, text_color ="B"):
if text_color in ("B", "W"):
tcolor = text_color
else:
tcolor = "B"
if tcolor == "B":
tcolor = "#000"
else:
tcolor = "#fff"
if version in versions_list:
renpy.show ("Events",what=Text(" Events " + str(events) + " / " + str(events_list[versions_list.index(version)]), size=40, color=tcolor), at_list=[topleft])
renpy.show ("ep1",what=Text(" Episode " + str(episode), size=40, color=tcolor), at_list=[topleft])
renpy.show ("Daytime", what = Text(day_depending_of_hour() + " " + str(shrink_hour(hour)) + ":" + get_minutes_string(minutes) + " ", size = 40, color = tcolor), at_list=[topright])
As background image I use this:
screen main_background():
imagemap:
if hour <= 16:
idle "main_day"
hover "main_day_h"
$ display_screen_header (get_reached_version_id())
if hour >= 17 and hour <= 20:
idle "main_sunset"
hover "main_sunset_h"
if hour >= 22:
idle "main_night"
hover "main_night_h"
hotspot (1556, 743, 200, 45) action Jump("home")
hotspot (1368, 691, 165, 45) action Jump("garden")
I want to combine my screen main_background(): with string: $ display_screen_header (get_reached_version_id())
But it doesn’t work.
My string works on a static background and my imagemap works without my string or more correctly – it’s not shown at all.
I hope that someone can tell me what’s wrong
Thank you very much in advance
I want to make a main screen with both hover buttons and variable strings including episode, day, time etc.
The string I want to include is
def display_screen_header (version, text_color ="B"):
if text_color in ("B", "W"):
tcolor = text_color
else:
tcolor = "B"
if tcolor == "B":
tcolor = "#000"
else:
tcolor = "#fff"
if version in versions_list:
renpy.show ("Events",what=Text(" Events " + str(events) + " / " + str(events_list[versions_list.index(version)]), size=40, color=tcolor), at_list=[topleft])
renpy.show ("ep1",what=Text(" Episode " + str(episode), size=40, color=tcolor), at_list=[topleft])
renpy.show ("Daytime", what = Text(day_depending_of_hour() + " " + str(shrink_hour(hour)) + ":" + get_minutes_string(minutes) + " ", size = 40, color = tcolor), at_list=[topright])
As background image I use this:
screen main_background():
imagemap:
if hour <= 16:
idle "main_day"
hover "main_day_h"
$ display_screen_header (get_reached_version_id())
if hour >= 17 and hour <= 20:
idle "main_sunset"
hover "main_sunset_h"
if hour >= 22:
idle "main_night"
hover "main_night_h"
hotspot (1556, 743, 200, 45) action Jump("home")
hotspot (1368, 691, 165, 45) action Jump("garden")
I want to combine my screen main_background(): with string: $ display_screen_header (get_reached_version_id())
But it doesn’t work.
My string works on a static background and my imagemap works without my string or more correctly – it’s not shown at all.
I hope that someone can tell me what’s wrong
Thank you very much in advance