With apologies, if the answer to this is right under my nose - I've been looking (and will continue to look) - but is it possible to customize the position of menu choice buttons, such as dialogue response choices, so that they can be anywhere on the screen? Right now they vertically stack in the center of the screen and I'd like to change that around. Is it possible?
Thanks in advance!
TD
Customizing Menu Choices
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.
- TomDowd
- Newbie
- Posts: 21
- Joined: Sun Oct 15, 2017 1:21 pm
- Completed: Historically, lead designer on MechAssault (Xbox), Duel Masters (PS2), and others. Co-creator of Shadowrun TTRPG and contributor to BattleTech, Earthdawn, Vampire: The Masquerade, and others.
- Projects: Currently working on VN Crush Depth
- Location: Chicago, IL
- Contact:
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: Customizing Menu Choices
The file screens.rpy has the screen choice, you can customize it as you need. You'll find some style choice... definitions below the screen.
Also gui.rpy has many definitions of styles applied to that screen and its elements, like spacing, positioning, width, etc. Look for the words "gui.choice_". There is an entire section for choice buttons.
You can adapt all of that as you wish.
Also gui.rpy has many definitions of styles applied to that screen and its elements, like spacing, positioning, width, etc. Look for the words "gui.choice_". There is an entire section for choice buttons.
You can adapt all of that as you wish.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
- TomDowd
- Newbie
- Posts: 21
- Joined: Sun Oct 15, 2017 1:21 pm
- Completed: Historically, lead designer on MechAssault (Xbox), Duel Masters (PS2), and others. Co-creator of Shadowrun TTRPG and contributor to BattleTech, Earthdawn, Vampire: The Masquerade, and others.
- Projects: Currently working on VN Crush Depth
- Location: Chicago, IL
- Contact:
Re: Customizing Menu Choices
Thank you - that was very helpful!
From looking at it and what properties are accessible it doesn't appear that there's any functionality for using the Menu system for anything other than a stacked set of choices - Is that accurate? I could not, for example, run them horizontally or control the individual location of choices (without ditching the Menu system and using custom buttons directly)?
Thanks again!
TD
From looking at it and what properties are accessible it doesn't appear that there's any functionality for using the Menu system for anything other than a stacked set of choices - Is that accurate? I could not, for example, run them horizontally or control the individual location of choices (without ditching the Menu system and using custom buttons directly)?
Thanks again!
TD
Re: Customizing Menu Choices
If you wanted to change your whole game to, say, horizontal instead of vertical, you could edit screens.rpy (the “choice” screen) to use an hbox instead of a vbox.
When you use the “menu” command, what Ren’py does is show the “choice” screen and pass in your choices. How they are displayed is then entirely up to the “choice” screen definition, which you can edit to your hearts content. I’ve seen games that have a global variable to select different formats within the choice screen at different points in the game, for example. So, sky’s the limit, depending on how good you are with screen language.
When you use the “menu” command, what Ren’py does is show the “choice” screen and pass in your choices. How they are displayed is then entirely up to the “choice” screen definition, which you can edit to your hearts content. I’ve seen games that have a global variable to select different formats within the choice screen at different points in the game, for example. So, sky’s the limit, depending on how good you are with screen language.
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: Customizing Menu Choices
You can use a global variable, as rames44 suggest that affect the choice screen and its appearance.
Or you can create different choice screens:
- copy the original one to another named, for example, "choice2" and change the appearance in the copy.
- then use renpy.display_menu to invoke your menus (it's tricky to construct the options, but works). https://www.renpy.org/doc/html/statemen ... splay_menu
Or you can create different choice screens:
- copy the original one to another named, for example, "choice2" and change the appearance in the copy.
- then use renpy.display_menu to invoke your menus (it's tricky to construct the options, but works). https://www.renpy.org/doc/html/statemen ... splay_menu
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
- TomDowd
- Newbie
- Posts: 21
- Joined: Sun Oct 15, 2017 1:21 pm
- Completed: Historically, lead designer on MechAssault (Xbox), Duel Masters (PS2), and others. Co-creator of Shadowrun TTRPG and contributor to BattleTech, Earthdawn, Vampire: The Masquerade, and others.
- Projects: Currently working on VN Crush Depth
- Location: Chicago, IL
- Contact:
Re: Customizing Menu Choices
Thanks! This all has helped tremendously, but I think I'm going to need a little bit more hand-holding...
Can you place a style block within an if statement? The answer seems to be no, since whenever I do that the code loads the second style block regardless of the value of the variable being tested. I have this:
Note that this is just to test the functionality. If I swap the 100 and 1000 value it's clear that the lower block is being read regardless of the value of NumChoices. NumChoices is set up (as default) elsewhere, not within a label.
What obvious thing am I missing? I'm guessing is that its how the use of style (if that's even appropriate) is handled. How then does one select different formats within the choice screen?
Thanks!
Can you place a style block within an if statement? The answer seems to be no, since whenever I do that the code loads the second style block regardless of the value of the variable being tested. I have this:
Code: Select all
if NumChoices == 1:
style choice_vbox:
ypos 100
else:
style choice_vbox:
ypos 1000
What obvious thing am I missing? I'm guessing is that its how the use of style (if that's even appropriate) is handled. How then does one select different formats within the choice screen?
Thanks!
Re: Customizing Menu Choices
No, you can use “if” to conditionally define styles, since they’re set up before your game runs.
What you should do is to create two different styles, then inside your screen you can have an “if” statement that either puts something in with one style, or else something (possibly the same thing) with the other style.
Or, you can use a style that omits the item that differs, and use the “if” technique to apply the common style plus the item that varies.
What you should do is to create two different styles, then inside your screen you can have an “if” statement that either puts something in with one style, or else something (possibly the same thing) with the other style.
Or, you can use a style that omits the item that differs, and use the “if” technique to apply the common style plus the item that varies.
Re: Customizing Menu Choices
Check this thread - viewtopic.php?f=8&t=52172#p497436