Vpgrid scrollbar position [Solved]

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
Dace
Newbie
Posts: 2
Joined: Thu Jun 13, 2019 6:02 pm
Contact:

Vpgrid scrollbar position [Solved]

#1 Post by Dace » Sat Jun 15, 2019 5:19 pm

Hi everyone,
I'm trying to set up a vpgrid with a scrollbar on the left side. I didn't find anything in the documentation about that (maybe because it's bad ui design do to it, but it makes sense in my case).

Is there a way to reverse the direction of the side ? Or to position the scrollbar manually ?

Thanks
Last edited by Dace on Sun Jun 16, 2019 10:04 pm, edited 1 time in total.

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

Re: Vpgrid scrollbar position

#2 Post by philat » Sun Jun 16, 2019 9:55 pm

You have to manually create the side (scrollbars automatically creates the side and I don't believe you can change that).

Sides: https://www.renpy.org/doc/html/screens.html#side
Example that this cribs from: https://www.renpy.org/doc/html/screens.html#viewport

Code: Select all

screen vpgrid_test():

    side "c l":

        vpgrid id "vp":

            cols 2
            spacing 5
            draggable True
            mousewheel True

            for i in range(1, 100):

                textbutton "Button [i]":
                    xysize (200, 50)
                    action Return(i)

        vbar value YScrollValue("vp")

User avatar
Dace
Newbie
Posts: 2
Joined: Thu Jun 13, 2019 6:02 pm
Contact:

Re: Vpgrid scrollbar position

#3 Post by Dace » Sun Jun 16, 2019 10:01 pm

To answer my own question :

Code: Select all

side "c l":
    vpgrid id "vp" :
         cols 2
         mousewheel True
     vbar value YScrollValue("vp")
I did try that before, but it made the bar jumpy. Turns out scrollbars don't like nested side elements.
Also, I have no idea how to achieve it with the side_ properties of the viewport. Some exemples in the documentation would be very helpful.

Edit: Thanks philat, I didn't see your answer.

Post Reply

Who is online

Users browsing this forum: Google [Bot]