adding a scrollbar to a choices list?

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
milk
Newbie
Posts: 3
Joined: Thu Jan 25, 2018 9:29 am
Projects: tales of link preservation project
Contact:

adding a scrollbar to a choices list?

#1 Post by milk » Thu Jan 25, 2018 9:37 am

hi! i'm new to ren'py, i just starting messing around with it a few days ago, and have found myself in a predicament.
is it possible to add a scrollbar to a list of choices that is too large to display on the screen at once?
(i know this sounds insane, but it's a lot simpler than what it implies i think.)

i've tried changing the size of the fonts, but it just makes it look clunky and hard to read.
i tried a few google searches but nothing came up for quite this problem.

i hope i'm being clear, i'm not used to speaking in like. technical language, especially not in regards to this. ;w;
breakin hearts and crashin programs

User avatar
Remix
Eileen-Class Veteran
Posts: 1311
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: adding a scrollbar to a choices list?

#2 Post by Remix » Fri Jan 26, 2018 8:25 am

You would want to amend the screen choice (in screens.rpy) to wrap the buttons in a scrollable area such as a viewport. There are examples of viewports in the same file, tutorial or documentation
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Develop Cartoon Speech Bubble dialogue
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

User avatar
milk
Newbie
Posts: 3
Joined: Thu Jan 25, 2018 9:29 am
Projects: tales of link preservation project
Contact:

Re: adding a scrollbar to a choices list?

#3 Post by milk » Sat Jan 27, 2018 9:42 am

thanks for responding! ^o^

good to know it should be able to be done..!

i've now certainly managed to add... uh, something, into the screen.
Image
the menu itself isn't in it, though, and the larger one doesn't scroll or anything?

there is definitely something i'm missing here... i looked in the tutorial but i didn't learn anything useful i don't think. :oops:

this is what i have now....

Code: Select all

screen choice(items):
    style_prefix "choice"

    frame:
        viewport:
            scrollbars "vertical"
            xmaximum 400
            ymaximum 400
            mousewheel True
            has vbox

    vbox:
        for i in items:
            textbutton i.caption action i.action

i'm really sorry if i'm missing something obvious >_<;
breakin hearts and crashin programs

User avatar
Empish
Veteran
Posts: 221
Joined: Thu Jan 14, 2016 9:52 pm
Projects: Efemural Hearts, It Ends With Graduation
itch: empish
Contact:

Re: adding a scrollbar to a choices list?

#4 Post by Empish » Sat Jan 27, 2018 10:43 am

You want your vbox with the items to be inside the viewport. So it and all its items need to be indented in a couple times.

User avatar
milk
Newbie
Posts: 3
Joined: Thu Jan 25, 2018 9:29 am
Projects: tales of link preservation project
Contact:

Re: adding a scrollbar to a choices list?

#5 Post by milk » Sat Jan 27, 2018 2:23 pm

oh wow oh my gosh it worked, thank you so much!
i need to tweak the way it looks, certainly, but this is wonderful, i'm so happy! thanks you so much! ;w;♥
breakin hearts and crashin programs

Post Reply

Who is online

Users browsing this forum: Andredron