Need help with Preferences Screen

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Tsuna
Newbie
Posts: 9
Joined: Thu Jul 24, 2014 12:39 pm
Contact:

Need help with Preferences Screen

#1 Post by Tsuna »

Hi, please help me with this small problem.

How can I make the boxes become narrower? It's too wide

Image

Thanks for helping.

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: Need help with Preferences Screen

#2 Post by OokamiKasumi »

Tsuna wrote:Hi, please help me with this small problem.
-- How can I make the boxes become narrower? It's too wide
What is your game size: 1280x760, 1366x768 or something else?

For a 1280x760 screen size...
Go to screens.rpy and add this at the bottom of screen preferences:

Code: Select all

################################ 
init -2:
    ## -------- grid --------------
    style prefs_grid:
        ypos 0.15 #How far over to the right. 
        xmaximum 900 #Max width for whole grid. 
        xalign 0.5 #Center

    ## ------- frame --------------
    style pref_frame:
        # background Frame("ui/frame.png",10,10) #If you have your own. 
        xfill True
        xmargin 3
        ymargin 3
        top_margin 5

    ## -------- vbox ---------------
    style pref_vbox:
        xfill True
        top_margin 75

    ## -----------------------------
    style soundtest_button:
        xalign 0.5 #Center the button
        
    ## ----- Label ------------------
    style pref_label:
        xalign 0.5 # center
It looks like this:
prefs.jpg
Note!
-- To make your Navigation Horizontal at the bottom:

Code: Select all

screen navigation:

    # The background of the game menu.
    window:
        style "gm_root"

    # The various buttons.
    frame:
        style_group "gm_nav"
        xalign .50
        yalign .98

        has hbox # Instead of vbox!

        textbutton _("Return") action Return()
        textbutton _("Settings") action ShowMenu("preferences")
        textbutton _("Save") action ShowMenu("save")
        textbutton _("LoadSaved") action ShowMenu("load")
        textbutton _("MainMenu") action MainMenu()
        textbutton _("Help") action Help()
        textbutton _("Quit") action Quit()

init -2:

    # Make all game menu navigation buttons the same size.
    style gm_nav_button:
        size_group "gm_nav"
To add a Label at the top of the Prefs screen, add this:

Code: Select all

screen preferences:
    tag menu
    use navigation

    frame:
        style_group "pref"
        xfill True
        has vbox
        label _("Game Settings?")

Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

Post Reply

Who is online

Users browsing this forum: No registered users