Customizing Preferences and Exit Menu

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
kaybdoodles
Newbie
Posts: 9
Joined: Sat Jan 21, 2017 7:54 pm
Tumblr: kaybdoodles
Contact:

Customizing Preferences and Exit Menu

#1 Post by kaybdoodles »

I've tried to look this up but I can't find any answers anywhere - or at least not ones specific enough. Also I'm pretty dumb when it comes to working in Renpy so it could be an easy fix. I'm trying to adjust the size, padding, and position of both the boxes in the preferences menu and the box in the menu that pops up when you try to quit the game early. I figure the way to adjust both are interrelated somehow but I just can't figure out how.
If you need my code or anything I can give that here, I just didn't want to spam the question with some code, especially since I don't know whether it would be in options or screens.

Thanks in advance for reading this and helping out!

MaximeChaos
Newbie
Posts: 9
Joined: Sat Feb 11, 2017 9:21 pm
Contact:

Re: Customizing Preferences and Exit Menu

#2 Post by MaximeChaos »

Line 337 of Screens.rpy if you use the legacy theme interface.
Line 712 if you use the new GUI.

Code: Select all

##############################################################################
# Preferences
#
# Screen that allows the user to change the preferences.
# http://www.renpy.org/doc/html/screen_special.html#preferences
All the codes following this are customizable.

kaybdoodles
Newbie
Posts: 9
Joined: Sat Jan 21, 2017 7:54 pm
Tumblr: kaybdoodles
Contact:

Re: Customizing Preferences and Exit Menu

#3 Post by kaybdoodles »

Ah yes that is where the customizing would be. How do I go about it though?

This is what my code looks like now for that area

Code: Select all


screen preferences:

    tag menu

    # Include the navigation.
    use navigation

    # Put the navigation columns in a three-wide grid.
    grid 2 1:
        style_group "prefs"
        xfill True

        # The left column.
        vbox:
            frame:
                style_group "pref"
                has vbox

                label _("Display")
                textbutton _("Window") action Preference("display", "window")
                textbutton _("Fullscreen") action Preference("display", "fullscreen")


            frame:
                style_group "pref"
                has vbox

                label _("Text Speed")
                bar value Preference("text speed")


                if config.has_voice:
                    textbutton _("Wait for Voice") action Preference("wait for voice", "toggle")

        vbox:
            frame:
                style_group "pref"
                has vbox

                label _("Music Volume")
                bar value Preference("music volume")

            frame:
                style_group "pref"
                has vbox

                label _("Sound Volume")
                bar value Preference("sound volume")

                if config.sample_sound:
                    textbutton _("Test"):
                        action Play("sound", config.sample_sound)
                        style "soundtest_button"

        

init -2 python:
    style.pref_frame.xfill = True
    style.pref_frame.xmargin = 5
    style.pref_frame.top_margin = 5

    style.pref_vbox.xfill = True

    style.pref_button.size_group = "pref"
    style.pref_button.xalign = 1.0

    style.pref_slider.xmaximum = 192
    style.pref_slider.xalign = 1.0

    style.soundtest_button.xalign = 1.0


I've messed around with the values a lot underneath the init -2 python: but nothing seems to change. Am I supposed to add code to it?
I cannot stress how new I am to doing this at all and I feel like I'm being kind of dumb, I'm sure its an easy solution

kaybdoodles
Newbie
Posts: 9
Joined: Sat Jan 21, 2017 7:54 pm
Tumblr: kaybdoodles
Contact:

Re: Customizing Preferences and Exit Menu

#4 Post by kaybdoodles »

Ok I have been doing some research of my own and I kind of understand how to work with styles now, I think what's confusing me is that I can't tell which style I'm supposed to fix. I keep trying to add code for the style 'prefs' but it keeps saying that style doesn't exist, even though its referenced in the prewritten code, same goes with 'pref'.
I've also determined that the padding is actually ok, the problem is that the label of each window is on the left most side of the window and the button is on the right most. Since I still can't figure out which style to adjust I can't center both though. I've attached an image of the screen, hopefully I'm correct in my assessment.

I really just want to make the windows less stretched out, maybe a bit bigger (with bigger text inside) and more centered on the screen, but I'm having trouble figuring that out.

I've also realized that the exit screen is probably under the yes/no prompt, but I can't find the style to adjust that window either.

Thanks again for your time and help
Attachments
Untitled.png

philat
Eileen-Class Veteran
Posts: 1910
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Customizing Preferences and Exit Menu

#5 Post by philat »

Use shift+I to check the style of any given element.

kaybdoodles
Newbie
Posts: 9
Joined: Sat Jan 21, 2017 7:54 pm
Tumblr: kaybdoodles
Contact:

Re: Customizing Preferences and Exit Menu

#6 Post by kaybdoodles »

shift+l? Do I do that in the game or in the screens file? I can't seem to get it to do anything in either, other than maybe typing in a capital 'L'

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Customizing Preferences and Exit Menu

#7 Post by Imperf3kt »

That's an I (eye), not an L.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

kaybdoodles
Newbie
Posts: 9
Joined: Sat Jan 21, 2017 7:54 pm
Tumblr: kaybdoodles
Contact:

Re: Customizing Preferences and Exit Menu

#8 Post by kaybdoodles »

Oh haha duh. Okay so I was able to do that with the preferences and I was able to change some things but not everything.
I'm trying to change the size of the font (Because I know how to change the size of the windows now but no point in making those bigger if the text is still tiny) and I've trying adding 'size' to every style that shows up - which I attached along with what it looks like.

Code: Select all

init -2 python:
    
    style.pref_frame.xfill = True
    style.pref_frame.xmargin = 1
    style.pref_frame.top_margin = 5
    style.prefs_grid.ypos = .4
    style.prefs_grid.xpos = .4
    style.pref_frame.left_margin = 5
    style.pref_frame.right_margin = 5
    style.pref_frame.bottom_margin = 5
    style.pref_frame.bottom_padding = 5
    style.pref_frame.right_padding = 5
    style.pref_frame.left_padding = 5
    style.pref_frame.top_padding = 5
    style.pref_grid.size = 70
    style.default.size = 50
        
    style.pref_frame.xsize = 300
    style.pref_frame.ysize = 100

    style.pref_vbox.xfill = True

    
    style.pref_button.size = 300
    style.pref_button.xmargin = 5
    style.pref_button.ymargin = 5
    style.pref_button.size_group = "pref"
    style.pref_button.xalign = 1.0

    style.pref_slider.xmaximum = 192
    style.pref_slider.xalign = 1.0

    style.soundtest_button.xalign = 1.0
Attachments
Untitled 2.png
Untitled.png

Post Reply

Who is online

Users browsing this forum: Google [Bot]