Page 1 of 1

Vpgrid scrollbar position [Solved]

Posted: Sat Jun 15, 2019 5:19 pm
by Dace
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

Re: Vpgrid scrollbar position

Posted: Sun Jun 16, 2019 9:55 pm
by philat
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")

Re: Vpgrid scrollbar position

Posted: Sun Jun 16, 2019 10:01 pm
by Dace
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.