(Solved) How to increase the left margin for a vertical scrollbar in a vpgrid

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
andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

(Solved) How to increase the left margin for a vertical scrollbar in a vpgrid

#1 Post by andriodmactemporary »

When creating a vpgrid the vertical scrollbar of that vpgrid is getting attached to the content of the grid, so how can I increase/change the margins for the scrollbar?

Image
Last edited by andriodmactemporary on Tue Apr 06, 2021 9:21 am, edited 1 time in total.

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: (Question) How to increase the left margin for a vertical scrollbar in a vpgrid

#2 Post by _ticlock_ »

Hi, andriodmactemporary,

I think you should use right_margin as a property of the vpgrid. I believe margin is not used for the scrollbars.

andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

Re: (Question) How to increase the left margin for a vertical scrollbar in a vpgrid

#3 Post by andriodmactemporary »

Vpgrid won't support "right_margin" property, it's giving :

line 34: u'right_margin' is not a keyword argument or valid child for the vpgrid statement.
right_margin 100

^

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: (Question) How to increase the left margin for a vertical scrollbar in a vpgrid

#4 Post by zmook »

andriodmactemporary wrote: Tue Feb 09, 2021 11:43 pm Vpgrid won't support "right_margin" property, it's giving :

line 34: u'right_margin' is not a keyword argument or valid child for the vpgrid statement.
right_margin 100

^
That's strange. This works for me:

Code: Select all

screen vpgrid_margins:

    vpgrid:
        cols 3
        scrollbars "vertical"
        draggable True
        align(0.5, 0.5)
        spacing 4
        right_margin 10
        
        for i in range(1,24):
            
            frame:
                xysize (300,300)
                add Solid("#4f9")
                text "hello"
If it still doesn't work for you, post the actual code you're using and I'll look at it.
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

Re: (Question) How to increase the left margin for a vertical scrollbar in a vpgrid

#5 Post by andriodmactemporary »

It's not working for me, below is my code you could go through it to resolve the problem. Thanks in advance

Code: Select all

 vpgrid:
            cols 3
            rows 4

            scrollbars "vertical"

            right_margin 10        # Error u'right_margin' is not a keyword argument or valid child for the vpgrid statement
            draggable True

            mousewheel True

            xalign 0.5
            yalign 0.5

            xspacing 75
            yspacing 10

            ymaximum 800

            for i in range(0, 12):
                frame:
                    style "gallerySlot"
                    imagebutton:
                        idle "shop_buying.png"
                        xalign 0.5
                        yalign 0.5
                        action Return()
                        

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: (Question) How to increase the left margin for a vertical scrollbar in a vpgrid

#6 Post by zmook »

So, this does work for me. It's a cut-and-paste of your code, with only three edits:
1. wrapped in a `screen` statement
2. "gallerySlot" style commented out
3. the idle image replaced with a `Solid()` placeholder

Is your Ren'py install up-to-date? I'm testing on 7.4.0.

Code: Select all

screen vpgrid_margins:

 vpgrid:
            cols 3
            rows 4

            scrollbars "vertical"

            right_margin 10        # Error u'right_margin' is not a keyword argument or valid child for the vpgrid statement
            draggable True

            mousewheel True

            xalign 0.5
            yalign 0.5

            xspacing 75
            yspacing 10

            ymaximum 800

            for i in range(0, 12):
                frame:
#                     style "gallerySlot"
                    imagebutton:
                        idle Solid("#afa",xysize=(200,200))
                        xalign 0.5
                        yalign 0.5
                        action Return()
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

Re: (Question) How to increase the left margin for a vertical scrollbar in a vpgrid

#7 Post by andriodmactemporary »

Thanks zmook I have updated the renpy to 4.2, it is working now.

Post Reply

Who is online

Users browsing this forum: Nozori_Games