Page 1 of 1

Viewport Help

Posted: Fri May 25, 2018 1:56 am
by BM90
Can anyone provide a link to a tutorial for viewports, or perhaps just provide a quick explanation on how to customize them. Currently I have something akin to a quest screen with a background and a vbox containing variable amounts of text. All I'm looking to do is make the text section scrollable when needed. I've done some searching, read through some older posts, and done my best to understand how these work, but I'm still at a loss. I can get the viewport to technically function, but as soon as I make any changes to the given examples I start to run into problems. Any help would be appreciated.

Re: Viewport Help

Posted: Fri May 25, 2018 7:33 pm
by kivik

Re: Viewport Help

Posted: Sat May 26, 2018 12:01 am
by BM90
I appreciate the link but sadly it still doesn't quite tell me what I need to know. Maybe it would be better to just ask more specifically for what I need. Here's an image of what I'm trying to achieve:

Image

Re: Viewport Help

Posted: Sat May 26, 2018 4:25 am
by kivik
Sorry was in a rush to go to bed. Here's the sample code from the official documentation that I used myself:
https://www.renpy.org/doc/html/screens.html#viewport

I've added comments at the end of each line for info

Code: Select all

screen viewport_example():
    side "c b r": # https://www.renpy.org/doc/html/screens.html#side for more info
         area (100, 100, 600, 400) # x, y, width, height (https://www.renpy.org/doc/html/style_properties.html?highlight=area#style-property-area)

         viewport id "vp": # the id to be used by the scroll bar
             draggable True # allows player to drag this

             add "washington.jpg" # replace this with your vbox list of content.

         vbar value YScrollValue("vp") # scrollbar, style this with using the bar properties: https://www.renpy.org/doc/html/screens.html#bar, i.e. common, position and bar style properties.

Re: Viewport Help

Posted: Mon May 28, 2018 11:39 pm
by BM90
Thanks you so much for spelling everything out for me. I probably spent three hours trying to figure this out on my own and with the links you provided I was able to get everything working in less than 10 minutes. Can't thank you enough.