How do I display the user-choice menu at specified positions?

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.
Post Reply
Message
Author
LTWasabi
Newbie
Posts: 3
Joined: Tue Jun 26, 2018 4:42 am
Contact:

How do I display the user-choice menu at specified positions?

#1 Post by LTWasabi »

I want to display an user-choice menu something like this :
XXX XXX XXX XXX
XXX XXX XXX XXX
XXX XXX XXX XXX
Please tell me how to do this.

User avatar
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: How do I display the user-choice menu at specified positions?

#2 Post by xavimat »

Well, maybe you could explain more.
I guess you mean, that you want 12 options in four columns and three rows, like this:
Option1 Option2 Option3 Option4
Option5 Option6 Option7 Option8
Option9 Option10 Option11 Option12

For this you can change the screen choice in screens.rpy.
Instead of vbox, put an hbox with box_wrap True.
Change the xsize of the texbutton-options (by default is very long) AND all your options should be short strings.

For example:

Code: Select all

screen choice(items):
    style_prefix "choice"

    hbox:
        align (.5, .45)
        box_wrap True
        for i in items:
            textbutton i.caption action i.action xsize 300
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)

LTWasabi
Newbie
Posts: 3
Joined: Tue Jun 26, 2018 4:42 am
Contact:

Re: How do I display the user-choice menu at specified positions?

#3 Post by LTWasabi »

xavimat wrote: Thu Jun 28, 2018 4:08 am

Code: Select all

screen choice(items):
    style_prefix "choice"

    hbox:
        align (.5, .45)
        box_wrap True
        for i in items:
            textbutton i.caption action i.action xsize 300
Just what I wanted! Thanks for the help.

Post Reply

Who is online

Users browsing this forum: Google [Bot]