Ren'Py How to adjust this start menu vbox?

fanaticfreedom

New Member
Dec 17, 2024
5
0
On the edges of my buttons, most noticeable on left side of help, about and quit., my drop shadow is cut off by an invisible box. I can't figure where this setting is stored, cant seem to find it in main_menu
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
11,421
17,380
On the edges of my buttons, most noticeable on left side of help, about and quit., my drop shadow is cut off by an invisible box. I can't figure where this setting is stored, cant seem to find it in main_menu
It's not due to an invisible box, but to the button height. And it's not in the "main_menu" screen, but in the "navigation" one, that you'll find the cue.

Python:
screen navigation():

    vbox:
        style_prefix "navigation"

[...]
        if main_menu:

            textbutton _("Start") action Start()

        else:

            textbutton _("History") action ShowMenu("history")
[...]
The buttons depend on the "navigation_button" style, that is defined as this:
style navigation_button is gui_button


Then when you look at the gui.py file, you find this:
Python:
## The width and height of a button, in pixels. If None, Ren'Py computes a size.
define gui.button_width = None
define gui.button_height = 54
The height value may be different, but it's surely what cause your issue.
Either change it to a value that do not cut the shadow or, better, follow the comment and put the value at None to let Ren'Py adjust the height to the image you'll use.
 

fanaticfreedom

New Member
Dec 17, 2024
5
0
It's not due to an invisible box, but to the button height. And it's not in the "main_menu" screen, but in the "navigation" one, that you'll find the cue.

Python:
screen navigation():

    vbox:
        style_prefix "navigation"

[...]
        if main_menu:

            textbutton _("Start") action Start()

        else:

            textbutton _("History") action ShowMenu("history")
[...]
The buttons depend on the "navigation_button" style, that is defined as this:
style navigation_button is gui_button


Then when you look at the gui.py file, you find this:
Python:
## The width and height of a button, in pixels. If None, Ren'Py computes a size.
define gui.button_width = None
define gui.button_height = 54
The height value may be different, but it's surely what cause your issue.
Either change it to a value that do not cut the shadow or, better, follow the comment and put the value at None to let Ren'Py adjust the height to the image you'll use.
Sadly this didn't work. :'(
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
11,421
17,380
Highly appreciate the time you're taking, here what shift i shows
I'm an idiot...

It's an image... Repeat after me AON, an image!

Changing the style for the textbutton style will obviously not affect an imagebutton, sorry.

I don't remember the gui having properties for them, so you'll have to extend the style manually. For this, add those to lines in either the "screen.rpy" file, or the "script.rpy" one:

Python:
style navigation_image_button:
    ysize 100
Just replace "100" by the height that apply for your buttons.

Normally this time it should works.
 
  • Like
Reactions: fanaticfreedom