Make viewport only show vertical scrollbar when needed?

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
henvu50
Regular
Posts: 92
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Make viewport only show vertical scrollbar when needed?

#1 Post by henvu50 » Wed Sep 05, 2018 2:12 pm

This code shows a vertical scrollbar on the right hand side of a viewport.

The problem is that the vertical scrollbar is shown at all times. I only want it to appear when the viewport is filled beyond the area limits.

Code: Select all


screen test_screen:
    frame:
        background Solid("#00000090")
        align (0.5, 0.5)

        side "c r":
            area (0, 0, 675, 675)
            viewport id "viewport_test":
                draggable True
                mousewheel True

                vbox:
                    for i in range(5):
                        text "{size=-12}test [i]{/size}"
            

                    
            vbar value YScrollValue("viewport_test")
            

User avatar
MaydohMaydoh
Regular
Posts: 101
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: Make viewport only show vertical scrollbar when needed?

#2 Post by MaydohMaydoh » Wed Sep 05, 2018 2:28 pm

Code: Select all

vbar value YScrollValue("viewport_test") unscrollable "hide"

henvu50
Regular
Posts: 92
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: Make viewport only show vertical scrollbar when needed?

#3 Post by henvu50 » Wed Sep 05, 2018 2:59 pm

Thanks

Post Reply

Who is online

Users browsing this forum: Google [Bot]