should vpgrid takes position size properties?

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
smollvrn
Newbie
Posts: 14
Joined: Sun Mar 14, 2021 3:24 pm
Contact:

should vpgrid takes position size properties?

#1 Post by smollvrn »

should vpgrid takes position size properties?

Image

Code: Select all

screen char:
     vpgrid:
            yfill True
            xminimum 427
            cols 1
            scrollbars "vertical"
            side_xalign 0.0
            vbox :
                text "1" 
label start:
     show screen char
     "scrollbar test"
return 

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: should vpgrid takes position size properties?

#2 Post by Imperf3kt »

vpgrid gets its size from its children and its position from its parent.
https://www.renpy.org/doc/html/screens.html#vpgrid
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

smollvrn
Newbie
Posts: 14
Joined: Sun Mar 14, 2021 3:24 pm
Contact:

Re: should vpgrid takes position size properties?

#3 Post by smollvrn »

Imperf3kt wrote: Sun May 23, 2021 4:16 pm vpgrid gets its size from its children and its position from its parent.
https://www.renpy.org/doc/html/screens.html#vpgrid
In addition, a vpgrid takes all properties a viewport can, and the following groups of style properties:

Common Properties
Position Style Properties
Position Style Properties
xmaximum - int
ymaximum - int
maximum - tuple of (int, int)
xminimum - int
yminimum - int
minimum - tuple of (int, int)
xsize - int
ysize - int
xysize - tuple of (int, int)
Grid Style Properties

https://www.renpy.org/doc/html/screens.html#vpgrid

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: should vpgrid takes position size properties?

#4 Post by PyTom »

So, this was a change in 7.3.3, albeit a obscure one - the xminimum and yminimum properties weren't listed as position properties. If a vpgrid has a side, position properties go to the side containing it, and not the viewport itself. To give the xminimum to the viewport, you need to use viewport_xminimum:

Code: Select all

screen char:
     vpgrid:
            yfill True
            viewport_xminimum 427
            cols 1
            scrollbars "vertical"
            side_xalign 0.0
            vbox :
                text "1" 
label start:
     show screen char
     "scrollbar test"
     return 
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users