Vertical scrollbar will not scale height

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
User avatar
oatnoodles
Regular
Posts: 71
Joined: Tue Aug 03, 2021 6:26 pm
Projects: Samuda Interval
Organization: Tomuwa Entertainment
Deviantart: oatnoodles
Github: oatnoodles
itch: oatnoodles
Discord: oatnoodles
Contact:

Vertical scrollbar will not scale height

#1 Post by oatnoodles »

Hello! I'm creating an inventory screen and setting up the layout first. I'm trying to get my vertical scrollbar to keep within the height of my vpgrid, but no matter what I try it just won't change the height of the scrollbar. It'll change the vpgrid's height instead of the scrollbar, even when changing settings in the style applied to the scrollbar.

Here's what it currently looks like:
Image

Here's my code:

Code: Select all

#(665, 292, 541, 607)
    vpgrid:

        cols 3
        spacing 25
        align (0.5, 0.5)
        mousewheel True
        draggable True
        area (665, 280, 541, 640)
        ymaximum 640
        scrollbars "vertical" style "playermenu_scrollbar"

        for i in range(1, 101):
            imagebutton:
                idle "gui/player_menu/inventory/circle_light.webp"
                hover "gui/player_menu/inventory/circle_dark.webp"
                action Return()
                
    style playermenu_scrollbar:
    ymaximum 640
                
 
Ren'py amateur looking to learn as much as possible! Please be patient with me.

User avatar
m_from_space
Miko-Class Veteran
Posts: 975
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Vertical scrollbar will not scale height

#2 Post by m_from_space »

oatnoodles wrote: Fri Dec 29, 2023 12:04 am Here's my code:
Not sure this is the issue, but can you format your code properly? Style definitions have to be set outside of screens etc. Also, why do you have two ymaximum properties inside the vpgrid? One from the ymaximum and one from the style.

It works on my end.

User avatar
oatnoodles
Regular
Posts: 71
Joined: Tue Aug 03, 2021 6:26 pm
Projects: Samuda Interval
Organization: Tomuwa Entertainment
Deviantart: oatnoodles
Github: oatnoodles
itch: oatnoodles
Discord: oatnoodles
Contact:

Re: Vertical scrollbar will not scale height

#3 Post by oatnoodles »

Sorry, I'm still pretty new to coding in general and for this project I've just been working with a "reorganized boilerplate code" from a previous programmer. That's how he organized things -- with the style definitions in the same file as the screen they're for. I have two ymaximums because it wasn't working no matter what I tried and it's just there from my attempts to get it to work.

Edit: The style settings aren't actually within the screen code, but they are on the same document.
Ren'py amateur looking to learn as much as possible! Please be patient with me.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Vertical scrollbar will not scale height

#4 Post by Donmai »

oatnoodles wrote: Tue Jan 02, 2024 4:04 pmThe style settings aren't actually within the screen code, but they are on the same document.
I still believe that's a good practice. It makes the script much more readable IMO (I'm not a programmer).
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: Bing [Bot]