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.
screen choice(items):
style_prefix "choice"
viewport:
area (240, 100, 843, 500) # scrollable area
if len(items) > 7: #only menus with more than 7 choices have the scrollbar
scrollbars "vertical"
mousewheel True
draggable True
vbox:
spacing 20
for i in items:
textbutton i.caption action i.action
It works, but now ALL in-game menus follow the "240, 100, 843, 500" position, it looks good with long menus but some menus with only a few choices are like that too. How can I move the menus without scrollbar back to the middle of the screen???
Last edited by scorlight on Wed Apr 15, 2020 12:47 am, edited 1 time in total.
screen choice(items):
if len(items) > 7:
style_prefix "choice"
viewport:
area (240, 100, 843, 500) # scrollable area
scrollbars "vertical"
mousewheel True
draggable True
vbox:
spacing 20
for i in items:
textbutton i.caption action i.action
else:
window:
style "menu_window"
vbox:
style "menu"
for i in items:
if i.action:
button:
action i.action
style "menu_choice_button"
text i.caption style "menu_choice"
else:
text i.caption style "menu_caption"
Thanks for the reply, I really didn't think about this option The code has a bug but I managed to find the solution from your suggestion, thank you so much!!