Render Main Menu Buttons' Text

This commit is contained in:
2021-07-02 10:32:31 +10:00
parent ab1ef7b47e
commit 367c7fd9a3
3 changed files with 49 additions and 18 deletions

View File

@@ -372,6 +372,22 @@ style navigation_button_text:
##
## https://www.renpy.org/doc/html/screen_special.html#main-menu
#similar to quick_button funcs
screen main_menu_button(filename, label, function):
button:
xmaximum 500
ymaximum 129
action function
fixed:
add filename xalign 0.5 yalign 0.5 zoom 1
text label xalign 0.5 yalign 0.5 xanchor 0.5
# label_functions is [ [ "label", function() ], [ "foobar", foobar() ], .. ]
# Reuse the same image string and keep things 'neat'.
screen main_menu_buttons(filename, label_functions):
for l_f in label_functions:
use main_menu_button(filename, l_f[0], l_f[1])
screen main_menu():
## This ensures that any other menu screen is replaced.
@@ -389,21 +405,29 @@ screen main_menu():
## The use statement includes another screen inside this one. The actual
## contents of the main menu are in the navigation screen.
vbox:
xpos 1940
yalign 0.03
if persistent.splashtype == 1:
add "gui/sneedgame.png"
else:
add "gui/snootgame.png"
xpos 1940
yalign 0.03
if persistent.splashtype == 1:
add "gui/sneedgame.png"
else:
add "gui/snootgame.png"
vbox:
spacing 25
xpos 1885
yalign 0.9
imagebutton auto "gui/button/menubuttons/startbutton_%s.png" action Start()
imagebutton auto "gui/button/menubuttons/loadbutton_%s.png" action ShowMenu("load")
imagebutton auto "gui/button/menubuttons/optionsbutton_%s.png" action ShowMenu("preferences")
imagebutton auto "gui/button/menubuttons/helpbutton_%s.png" action ShowMenu("extras")
imagebutton auto "gui/button/menubuttons/quitbutton_%s.png" action Quit(confirm=not main_menu)
spacing 25
xpos 1885
yalign 0.9
use main_menu_buttons("gui/button/menubuttons/template_idle.png",
[ \
[ "Start", Start() ], \
[ "Load", ShowMenu("load") ], \
[ "Options", ShowMenu("preferences") ], \
[ "Help & About", ShowMenu("extras") ], \
[ "Quit", Quit(confirm=not main_menu) ] \
] )
#imagebutton auto "gui/button/menubuttons/startbutton_%s.png" action Start()
#imagebutton auto "gui/button/menubuttons/loadbutton_%s.png" action ShowMenu("load")
#imagebutton auto "gui/button/menubuttons/optionsbutton_%s.png" action ShowMenu("preferences")
#imagebutton auto "gui/button/menubuttons/helpbutton_%s.png" action ShowMenu("extras")
#imagebutton auto "gui/button/menubuttons/quitbutton_%s.png" action Quit(confirm=not main_menu)
# if gui.show_name:
@@ -433,7 +457,10 @@ style main_menu_vbox:
yoffset -30
style main_menu_text:
properties gui.text_properties("main_menu", accent=True)
properties gui.text_properties("main_menu") #, accent=True)
color gui.main_menu_color
hover_color gui.hover_color
size gui.main_menu_text_size
style main_menu_title:
properties gui.text_properties("title")
@@ -851,7 +878,7 @@ screen preferences():
style_prefix "check"
label _("Naughty Stuff")
textbutton _("Enable Lewd Images") action ToggleVariable("persistent.lewd", True, False)
vbox:
style_prefix "check"
label _("Requires Restart")