Hi, is it possible to call more than one button at a time? I've tried searching the board but the site times out before I can get a result. I know I can do an imagemap but I'm wondering if it's possible to do several buttons at once.
Thanks!
Calling Multiple Buttons?
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.
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: Calling Multiple Buttons?
I'm not sure I understand you correctly, but you make a button as part of a screen, and you can have as many buttons in that screen as there is space for.
Code: Select all
screen map():
textbutton "Home" action Jump("home") pos (5, 30)
textbutton "Park" action Jump("park") pos (5, 50)
textbutton "School" action Jump("school") pos (5, 70)
- dGameBoy101b
- Regular
- Posts: 31
- Joined: Sun Aug 12, 2018 8:32 am
- itch: dgameboy101b
- Contact:
Re: Calling Multiple Buttons?
You can group together various screen elements, like buttons, using various grouping elements like vertical boxes, horizontal boxes, grids, fixed size boxes, or just by listing multiple elements in the screen.
Code: Select all
screen test:
vbox:
button "Skip" action Skip()
button "Save" action ShowMenu('save')
Re: Calling Multiple Buttons?
Thank you guys. Sorry for the confusing question. I shouldn't write questions at 7 am after pulling an all-nighter to hit deadlines. Looks like my understanding of screens and buttons were fundamentally wrong. I was creating 1 screen per button and because of that wasn't able to see multiple buttons since you can only call one screen at a time.
I will not put all the buttons for any given scene on one screen instead.
I will not put all the buttons for any given scene on one screen instead.
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: Calling Multiple Buttons?
You can have more than one screen on at once using show menu, so you are not necessarily limited to show one screen at the time. Usually it is practical to have all elements you want in one screen, but it is not necessary.
When you are thinking about screens I don't think you should primarily think about it in terms of the graphics. Screens is what is used for the user to communicate with the game. Dialogue, quickmenu and chose menus are also screens.
You can have screens without any graphics.
Here you have an example of a screen with no graphics that takes keyboard input (q, w and e) to jump between labels.
Code: Select all
screen keys():
key "q" action Jump("home_")
key "w" action Jump("park_")
key "e" action Jump("school_")
label start:
show screen keys
label home_:
"Welcome home."
pause
label park_:
"Welcome to the park."
pause
label school_:
"Welcome to the school."
pause
Re: Calling Multiple Buttons?
Thank you Per K Grok, that was really informative and helpful!
Who is online
Users browsing this forum: apocolocyntose, Bing [Bot], Google [Bot]