Given a viewport on a screen that contains a vbox, where the vbox will have a variable number of items, where the items themselves will be of variable height.
Is there a way to automatically detect whether the child content of the viewport (i.e. the vertical height of the vbox) exceeds the viewport size and automatically enable/disable the vertical scrollbar on the viewport based on this? Visually, I would like to have the scrollbar appear when the viewport is scrollable, but be hidden when it isn't needed.
(Apologies if this is already covered here somewhere - my Google Fu wasn't up to finding it.)
Auto enable/disable scrollbar on viewport
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.
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.
- 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: Auto enable/disable scrollbar on viewport
Yes, that's the purpose of the "unscrollable" property.
https://www.renpy.org/doc/html/style_pr ... scrollable
https://www.renpy.org/doc/html/style_pr ... scrollable
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Who is online
Users browsing this forum: Majestic-12 [Bot], piinkpuddiin, Semrush [Bot], snotwurm