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.
Silence in Space
Regular
Posts: 31 Joined: Tue Nov 22, 2016 4:48 pm
Projects: Silence in Space
Contact:
#1
Post
by Silence in Space » Thu Dec 08, 2016 4:21 pm
Code: Select all
label terminal_entries:
menu:
"Entry_001"
"Entry_002"
"Entry_003"
"Entry_004"
"Entry_005"
"Entry_006"
"Entry_007"
"Entry_008"
"Entry_009"
"Entry_010"
"Entry_011"
"Entry_012"
"Entry_013"
How could would you make an scroll-bar feature for an in-game menu such as a long one like this?
Silence in Space
Regular
Posts: 31 Joined: Tue Nov 22, 2016 4:48 pm
Projects: Silence in Space
Contact:
#2
Post
by Silence in Space » Fri Dec 09, 2016 9:58 am
I'm not having any success with replicating any of the viewport and scrollbar examples.
nyaatrap
Crawling Chaos
Posts: 1824 Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:
#3
Post
by nyaatrap » Fri Dec 09, 2016 3:48 pm
Add viewport on the choice screen in screens.rpy.
Code: Select all
screen choice(items):
style_prefix "choice"
viewport:
scrollbars "vertical"
mousewheel True
draggable True
side_yfill True
vbox:
for i in items:
textbutton i.caption action i.action
Silence in Space
Regular
Posts: 31 Joined: Tue Nov 22, 2016 4:48 pm
Projects: Silence in Space
Contact:
#4
Post
by Silence in Space » Fri Dec 09, 2016 8:00 pm
nyaatrap wrote: Add viewport on the choice screen in screens.rpy.
Code: Select all
screen choice(items):
style_prefix "choice"
viewport:
scrollbars "vertical"
mousewheel True
draggable True
side_yfill True
vbox:
for i in items:
textbutton i.caption action i.action
The scrollbar appears now in game; however, this is what happens.
Attachments
papiersam
Veteran
Posts: 231 Joined: Fri Aug 12, 2016 2:24 pm
Completed: Gem Hunt Beta, 1/Probably, Animunch
Projects: The Panda Who Dreamed
Contact:
#5
Post
by papiersam » Fri Dec 09, 2016 8:51 pm
Might wanna change the
child size , something like:
Code: Select all
screen choice(items):
style_prefix "choice"
side "c b r":
area (100, 100, 600, 400)
viewport:
scrollbars "vertical"
mousewheel True
draggable True
side_yfill True
vbox:
for i in items:
textbutton i.caption action i.action
(Note: not tested).
Silence in Space
Regular
Posts: 31 Joined: Tue Nov 22, 2016 4:48 pm
Projects: Silence in Space
Contact:
#6
Post
by Silence in Space » Sat Dec 10, 2016 12:57 am
The entire code for script.ryp
Code: Select all
## The script of the game goes in this file.
## Declare characters used by this game. The color argument colorizes the name
## of the character.
image bg blackness = "Nothingness.png"
init:
$ c = Character(_(None),
kind=nvl,
what_font="whitrabt.ttf",
what_slow_cps=27)
## The game starts here.
label start:
"You access the terminal."
c "Booting up System Archieve"
nvl clear
c "Which entry do you wish to access?"
nvl clear
label terminal_monitor:
menu:
"Access Archieve":
jump terminal_entries
"Leave Terminal":
return
The entire code for terminal_entries.rpy
Code: Select all
define entry001 = "alpha"
define entry002 = "beta"
define entry003 = "delta"
define entry004 = "gamma"
define entry005 = "sigma"
define entry006 = "lambda"
define entry007 = "tau"
define entry008 = "phi"
define entry009 = "pi"
define entry010 = "omega"
define entry011 = "15876"
define entry012 = "22179"
define entry013 = "54897"
label terminal_entries:
menu:
"Entry_001":
jump terminal_entry_001
"Entry_002":
jump terminal_entry_002
"Entry_003":
jump terminal_entry_003
"Entry_004":
jump terminal_entry_004
"Entry_005":
jump terminal_entry_005
"Entry_006":
jump terminal_entry_006
"Entry_007":
jump terminal_entry_007
"Entry_008":
jump terminal_entry_008
"Entry_009":
jump terminal_entry_009
"Entry_010":
jump terminal_entry_010
"Entry_011":
jump terminal_entry_011
"Entry_012":
jump terminal_entry_012
"Entry_013":
jump terminal_entry_013
label terminal_entry_001:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_001")
if password == entry001:
jump entry_001_terminal
else:
jump invalid
label terminal_entry_002:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_002")
if password == entry002:
jump entry_002_terminal
else:
jump invalid
label terminal_entry_003:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_003")
if password == entry003:
jump entry_003_terminal
else:
jump invalid
label terminal_entry_004:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_004")
if password == entry004:
jump entry_004_terminal
else:
jump invalid
label terminal_entry_005:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_005")
if password == entry005:
jump entry_005_terminal
else:
jump invalid
label terminal_entry_006:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_006")
if password == entry006:
jump entry_006_terminal
else:
jump invalid
label terminal_entry_007:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_007")
if password == entry007:
jump entry_007_terminal
else:
jump invalid
label terminal_entry_008:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_008")
if password == entry008:
jump entry_008_terminal
else:
jump invalid
label terminal_entry_009:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_009")
if password == entry009:
jump entry_009_terminal
else:
jump invalid
label terminal_entry_010:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_010")
if password == entry010:
jump entry_010_terminal
else:
jump invalid
label terminal_entry_011:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_011")
if password == entry011:
jump entry_011_terminal
else:
jump invalid
label terminal_entry_012:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_012")
if password == entry012:
jump entry_012_terminal
else:
jump invalid
label terminal_entry_013:
c "Please enter password."
$ password = renpy.input("Enter Password for Entry_013")
if password == entry013:
jump entry_013_terminal
else:
jump invalid
label entry_001_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c "..........................."
jump terminal_monitor
label entry_002_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c "..........................."
nvl clear
jump terminal_monitor
label entry_003_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c ".........................."
nvl clear
jump terminal_monitor
label entry_004_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c ".........................."
nvl clear
jump terminal_monitor
label entry_005_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c ".........................."
nvl clear
jump terminal_monitor
label entry_006_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c ".........................."
nvl clear
jump terminal_monitor
label entry_007_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c "..........................."
nvl clear
jump terminal_monitor
label entry_008_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c "............................"
nvl clear
jump terminal_monitor
label entry_009_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c "............................."
nvl clear
jump terminal_monitor
label entry_010_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c "............................."
nvl clear
jump terminal_monitor
label entry_011_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c "............................"
nvl clear
jump terminal_monitor
label entry_012_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c "............................"
nvl clear
jump terminal_monitor
label entry_013_terminal:
nvl clear
c "Authorization Granted"
nvl clear
c ".............................."
nvl clear
jump terminal_monitor
label invalid:
nvl clear
c "INVALID PASSWORD"
nvl clear
jump terminal_monitor
Silence in Space
Regular
Posts: 31 Joined: Tue Nov 22, 2016 4:48 pm
Projects: Silence in Space
Contact:
#7
Post
by Silence in Space » Sat Dec 10, 2016 12:59 am
r_sami wrote: Might wanna change the
child size , something like:
Code: Select all
screen choice(items):
style_prefix "choice"
side "c b r":
area (100, 100, 600, 400)
viewport:
scrollbars "vertical"
mousewheel True
draggable True
side_yfill True
vbox:
for i in items:
textbutton i.caption action i.action
(Note: not tested).
Regardless of where it is put in the coding, it will always show a blank screen for the first menu (i.e. in script.rpy) making impossible to test any of the other menus.
It does not result in an error, unless placed after menu. script.rpy and terminal_entries.rpy function correctly without this.
nyaatrap
Crawling Chaos
Posts: 1824 Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:
#8
Post
by nyaatrap » Sat Dec 10, 2016 10:21 am
Wrap viewport by fixed or frame, giving its xysize. You only need to modify screens.rpy.
Code: Select all
screen choice(items):
style_prefix "choice"
fixed pos (x,y) xysize (x,y): #or frame, window
viewport:
scrollbars "vertical"
mousewheel True
draggable True
side_yfill True
vbox:
for i in items:
textbutton i.caption action i.action
scorlight
Regular
Posts: 67 Joined: Fri Sep 13, 2013 7:02 am
Contact:
#9
Post
by scorlight » Wed Apr 08, 2020 10:08 am
I know it's late but in case someone still need it, this is the code I use
Code: Select all
screen choice(items):
window:
style_prefix "choice"
area (240, 112, 843, 400)
viewport:
if len(items) >= 6:
scrollbars "vertical"
mousewheel True
draggable True
vbox:
spacing 20
for i in items:
textbutton i.caption action i.action
I got it from this post:
viewtopic.php?f=8&t=41504
Triority
Regular
Posts: 185 Joined: Fri Jul 20, 2018 1:28 pm
Completed: Welcome To... Chichester 0, 1,2 OVN 1, OVN 2, OVN 3, No Regrets For The Future
Projects: Welcome To... Chichester series
Organization: Triority
Tumblr: Sku-te
itch: triority
Location: England
Discord: sku_te
Contact:
#10
Post
by Triority » Wed Jul 29, 2020 4:24 pm
The problem with that is the options wont appear inside the defined area. Have to get rid of the window command for it to work correctly
Users browsing this forum: No registered users