How to drag down viewport while holding choice button

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
User avatar
Colt
Newbie
Posts: 3
Joined: Thu Aug 01, 2013 1:16 pm
Projects: Shining Days
Location: Brazil
Contact:

How to drag down viewport while holding choice button

#1 Post by Colt » Sat Feb 27, 2021 10:11 pm

Hello, I was wondering if there's a way to drag down a menu choice viewport while clicking and holding over the choices. I need to do this because on android, you can't go down in the viewport without holding your finger over the scrollbar or in the space between choices and they're very narrow. I'm using:

Code: Select all

screen choice(items):
    frame:
        style_prefix "nvl_menu_choice_button"
        top_padding 10 bottom_padding 10 left_padding 10 right_padding 85
        area (45, 1000, 1120, 900)
        viewport:
            if len(items) >= 2:
                scrollbars "vertical"
                mousewheel True
                draggable True

            has vbox:
                spacing 45
                xalign 0.5
                xminimum 150

                for i in items:
                    textbutton i.caption action i.action
screenshot:
Image


Also, I was wondering if there's a way to make my choice text somehow be allign? I've tried messing around things, but failed everytime. They're always irregular, with the right margin differing in every menu.

Thank you in advance!

cheonbyeol
Regular
Posts: 37
Joined: Thu Feb 04, 2021 9:04 am
Contact:

Re: How to drag down viewport while holding choice button

#2 Post by cheonbyeol » Sun Feb 28, 2021 2:13 pm

Mm. Would it be possible to have shorter text in the choice buttons?
Something that sums up the idea, then the MC or narrator can elaborate in the dialogue block.
Or I'd even consider something like

Code: Select all

label x:
    menu:
        "Question...."
        "option A":
            "Text"
            "Text"
            "Text"
            menu:
                "Are you certain?":
                "Yes":
                    jump label a
                "Reconsider":
                    jump label x #back to first menu
        "option B":
            "Text"
            "Text"
            "Text"
            menu:
                "Are you certain?":
                "Yes":
                    jump label b
                "Reconsider":
                    jump label x #back to menu

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: How to drag down viewport while holding choice button

#3 Post by Alex » Sun Feb 28, 2021 3:33 pm

Colt wrote:
Sat Feb 27, 2021 10:11 pm
Hello, I was wondering if there's a way to drag down a menu choice viewport while clicking and holding over the choices. I need to do this because on android, you can't go down in the viewport without holding your finger over the scrollbar or in the space between choices and they're very narrow....
You could try either make the scrollbar wider or put the choices vbox inside an hbox as the first element and 'null width 50' as the second element, so there will be some empty space where player will be able to drag the choices list.
https://www.renpy.org/doc/html/screens.html#null

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]