This is is how i register styles preferences:
Code: Select all
init -2 python:
# Outline
renpy.register_style_preference("text_outline", True, style.say_dialogue, "outlines", [(1, (0, 0, 0, 255), 0, 0)])
renpy.register_style_preference("text_outline", False, style.say_dialogue, "outlines", [(0, (0, 0, 0, 0), 0, 0)])
# Shadow
renpy.register_style_preference("text_shadow", True, style.say_dialogue, "drop_shadow", [(2, 2)])
renpy.register_style_preference("text_shadow", False, style.say_dialogue, "drop_shadow", [(0, 0)])
# Justification
renpy.register_style_preference("text_justify", True, style.say_dialogue, "justify", True)
renpy.register_style_preference("text_justify", False, style.say_dialogue, "justify", False)
Code: Select all
default persistent.textbox_transparency = 0.9
default text_outline = False
default text_shadow = False
default text_justify = False
default text_sfx = True
screen settings_disable:
modal True
timer 2 action Hide("settings_disable")
screen settings(fromPause=False,fromMain=False):
tag menu
modal True
key "game_menu" action Return()
python:
xy = renpy.get_physical_size()
if not fromPause:
add gui.mm_background
fixed:
if fromPause == False:
at gui_no_fade_inout
else:
at gui_fade_out
add "gui_overlay"
use exit_button_noAnim
add "gui/log_decor_top.png" at gui_overlaydecor_top_noAnim
frame:
background None
xsize 1200
at gui_overlaydecor_bottom_noAnim
add "gui/settings_decor_bottom.png":
alpha 0.3
text "SETTINGS":
style "gui_overlay_title"
viewport id "vp":
mousewheel True
draggable True
xsize 1200 xalign 0.5
ysize 860 yalign 0.49
yinitial 0.0
vbox:
xsize 1130
spacing 30
vbox:
xsize 1130
ypos 10
spacing 7
hbox:
ysize 60
xalign 0.0
spacing 50
text "Onomatopeias" style "settings_header"
hbox:
spacing 30
button:
xsize 150 ysize 60
at gui_buttonfade_noAnim
hovered Play("system",guisfx_button_hover)
action [Play("system",guisfx_button_click),
SetVariable("text_sfx", True)]
add "gui/settings_show_idle.png"
text "SHOW" style "settings_button_text"
button:
xsize 125 ysize 60
at gui_buttonfade_noAnim
hovered Play("system",guisfx_button_hover)
action [Play("system",guisfx_button_click),
SetVariable("text_sfx", False)]
add "gui/settings_hide_idle.png"
text "HIDE" style "settings_button_text"
hbox:
ysize 60
xalign 0.0
spacing 50
text "Text Outline" style "settings_header"
hbox:
spacing 30
button:
xsize 150 ysize 60
at gui_buttonfade_noAnim
hovered Play("system",guisfx_button_hover)
action [Play("system",guisfx_button_click),
StylePreference("text_outline", True)]
add "gui/settings_show_idle.png"
text "SHOW" style "settings_button_text"
button:
xsize 125 ysize 60
at gui_buttonfade_noAnim
hovered Play("system",guisfx_button_hover)
action [Play("system",guisfx_button_click),
StylePreference("text_outline", False)]
add "gui/settings_hide_idle.png"
text "HIDE" style "settings_button_text"
hbox:
ysize 60
xalign 0.0
spacing 50
text "Text Shadow" style "settings_header"
hbox:
spacing 30
button:
xsize 150 ysize 60
at gui_buttonfade_noAnim
hovered Play("system",guisfx_button_hover)
action [Play("system",guisfx_button_click),
StylePreference("text_shadow", True)]
add "gui/settings_show_idle.png"
text "SHOW" style "settings_button_text"
button:
xsize 125 ysize 60
at gui_buttonfade_noAnim
hovered Play("system",guisfx_button_hover)
action [Play("system",guisfx_button_click),
StylePreference("text_shadow", False)]
add "gui/settings_hide_idle.png"
text "HIDE" style "settings_button_text"
hbox:
ysize 60
xalign 0.0
spacing 50
text "Text Justify" style "settings_header"
hbox:
spacing 30
button:
xsize 95 ysize 60
at gui_buttonfade_noAnim
hovered Play("system",guisfx_button_hover)
action [Play("system",guisfx_button_click),
StylePreference("text_justify", True)]
add "gui/settings_on_idle.png"
text "ON" style "settings_button_text"
button:
xsize 110 ysize 60
at gui_buttonfade_noAnim
hovered Play("system",guisfx_button_hover)
action [Play("system",guisfx_button_click),
StylePreference("text_justify", False)]
add "gui/settings_off_idle.png"
text "OFF" style "settings_button_text"
vbox:
xsize 1130 ysize 200
spacing 40
yoffset 20
vbox:
xsize 1130
xalign 0.5 ysize 70
text "Textbox Transparency" style "settings_header" xalign 0.5
hbox:
xsize 1130 xalign 0.5
spacing 13
text "TRANSPARENT":
xsize 85 xalign 1.0
style "caption_med"
kerning gui.advname_font_kerning
bar:
hovered Play("system",guisfx_button_hover)
value FieldValue(persistent, "textbox_transparency", range=0.5, offset=0.5)
base_bar "gui/settings_text_bar.png"
thumb "gui/settings_text_thumb.png"
xsize 862 ysize 22
xalign 0.5 yoffset 3
at gui_buttonfade_noAnim
text "SOLID":
xsize 85 xalign 0.0 xoffset 4
style "caption_med"
kerning gui.advname_font_kerning