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.
I've tried for many frustrating hours now to put a scrollbar on a viewport. Yes, I've read through the documentation and googled similar issues, but nothing has worked.
My code is below. I have to contain the contents of the viewport (the contents that I want to be scrollable) in boxes. Otherwise, for some reason they all appear layered on top of one another. Yet then when I try to add a vertical bar to scroll the contents, depending where in the code I put the bar, either it appears over top of the contents, or the length of the bar is much shorter than required, or the bar appears after the contents, or the bar doesn't appear at all.
screen goals():
tag menu
use game_menu(_("Goals"))
vbox:
xalign .6
use goalsFilterPick()
viewport id "vp":
draggable True
mousewheel True
arrowkeys True
pagekeys True
anchor (0,0)
align (.25, .09)
hbox:
xsize 1350
vbox:
#CONTENTS GO HERE
vbox:
vbar value YScrollValue("vp") #[u]WON'T PAIR WITH CONTENTS OF OTHER VBOX
paulyboyx wrote: ↑Sun Nov 26, 2023 5:19 pm
I've tried for many frustrating hours now to put a scrollbar on a viewport. Yes, I've read through the documentation and googled similar issues, but nothing has worked.
You don't need a vbar for it, but if you do so, you have to place it outside of the viewport of course. You did place it inside the viewport. But here is a simpler way: