Hello! I'm trying to add a scrollbar into a screen. It's an information journal, an in order to avoid making pages (in case it goes over), it would be much better to be able to scroll!
Does anyone know how to do this?
Also, I'm going to be inputting all the writing in the screen. Will the text function work? Or is there another way to input the text?
If there isn't a way to do this, I can just avoid to go over, or simply make pages.
Thank you!
(Here's a diagram of what I'm trying to do)
Adding a scrollbar [SOLVED]
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.
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.
- Llunet1
- Regular
- Posts: 55
- Joined: Mon Oct 21, 2013 8:56 pm
- Projects: Reminiscence, Blood
- Deviantart: llunet1
- Location: USA
- Contact:
Adding a scrollbar [SOLVED]
Last edited by Llunet1 on Tue Jan 06, 2015 11:14 pm, edited 1 time in total.
- Dragonstar89
- Regular
- Posts: 163
- Joined: Mon Aug 12, 2013 11:28 pm
- Projects: TBA
- Organization: Self
- IRC Nick: dstar89
- Deviantart: senpai-jake
- Skype: dstar_891
- Location: West Virginia, USA
- Contact:
Re: Adding a scrollbar
You can use Ren'Py's "Frame" code to add a scrollbar. For example, I added the code to my Music Room list to make the vbox list have a scrollbar. You could start out like this:
Then, after all of your text/inner content has been defined, use this: (but make sure it stays indented within the "viewport" block. Basically, a full section of code could look like this:
However, this is just how to do it in barebones. The official documentation has a much better explanation and example on things like what "side("c r")" is, what to use null height for, etc. Also this won't mess up your text. You can still display your text like any other screen. I forgot to mention that in a screen, (IIRC) you have to use to display text because it is the screen code.
Code: Select all
frame:
side ("c r"):
area (1,0,280,600)
viewport id "music_list":
draggable True mousewheel True
Code: Select all
vbar value YScrollValue("music_list")
Code: Select all
frame:
side ("c r"):
area (1,0,280,600)
viewport id "my_scroller": #REMEMBER YOUR VIEWPORT ID SO THE SCROLLBAR IS PLACED FOR IT
draggable True mousewheel True
text "this is my text."
textbutton "This is my Button" action Start()
vbar value YScrollValue("my_scroller") #TAKES YOUR VIEWPORT ID AS THE ARG
null height 20 #just a height set.
Code: Select all
text "my text here"
Beginning pre-production work on a project in Renpy. After being away for 5 years, it's time to get back in the game
- Llunet1
- Regular
- Posts: 55
- Joined: Mon Oct 21, 2013 8:56 pm
- Projects: Reminiscence, Blood
- Deviantart: llunet1
- Location: USA
- Contact:
Re: Adding a scrollbar
Thank you so much! I finally got it to work~
- Llunet1
- Regular
- Posts: 55
- Joined: Mon Oct 21, 2013 8:56 pm
- Projects: Reminiscence, Blood
- Deviantart: llunet1
- Location: USA
- Contact:
Re: Adding a scrollbar [SOLVED]
Actually. The text isn't showing up. So, while the scrollbar is there... there seems to be nothing in it?
*Edit* Figured out what the problem was. The text statements should be on the same indent as the "draggable True..." line.
Once again, thank you~
*Edit* Figured out what the problem was. The text statements should be on the same indent as the "draggable True..." line.
Once again, thank you~
- Dragonstar89
- Regular
- Posts: 163
- Joined: Mon Aug 12, 2013 11:28 pm
- Projects: TBA
- Organization: Self
- IRC Nick: dstar89
- Deviantart: senpai-jake
- Skype: dstar_891
- Location: West Virginia, USA
- Contact:
Re: Adding a scrollbar [SOLVED]
Yeah, sorry I forgot to mention that. You'r welcomeLlunet1 wrote:Actually. The text isn't showing up. So, while the scrollbar is there... there seems to be nothing in it?
*Edit* Figured out what the problem was. The text statements should be on the same indent as the "draggable True..." line.
Once again, thank you~
Beginning pre-production work on a project in Renpy. After being away for 5 years, it's time to get back in the game
Re: Adding a scrollbar [SOLVED]
I'm trying to do it but I can't scroll down to see text below the seeing range
Code: Select all
screen quiz:
add "wood.jpg"
frame:
xpos 200
side ('c r'):
area (0,0,1280,720)
viewport id "quiz_sheet":
draggable True mousewheel True
add "sheet.jpg"
text _("""{color=000}Sample text{/color}""")
textbutton "Yes" ypos 100
text _("{color=000}This is far below{/color}") ypos 1000
vbar value YScrollValue("quiz_sheet")
Who is online
Users browsing this forum: No registered users