Choices in columns instead of rows?

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
User avatar
Roselia-Thorns
Regular
Posts: 27
Joined: Tue Sep 13, 2016 10:01 pm
Projects: Undertale: Kissy Cutie
Tumblr: roseradetea
itch: roseradetea
Contact:

Choices in columns instead of rows?

#1 Post by Roselia-Thorns » Fri Jul 28, 2017 7:28 pm

I want my choices to be in columns instead of rows.
Let's say I have this
Image

And I want it to look something like this
Image

User avatar
Vnigma
Regular
Posts: 29
Joined: Wed Sep 16, 2015 6:43 pm
Projects: Origin of War
Organization: VNigma
Contact:

Re: Choices in columns instead of rows?

#2 Post by Vnigma » Sat Jul 29, 2017 8:46 am

you must edit the choice menu in the screen file to display the menu programmiaclly

User avatar
Roselia-Thorns
Regular
Posts: 27
Joined: Tue Sep 13, 2016 10:01 pm
Projects: Undertale: Kissy Cutie
Tumblr: roseradetea
itch: roseradetea
Contact:

Re: Choices in columns instead of rows?

#3 Post by Roselia-Thorns » Sat Jul 29, 2017 1:34 pm

Ah sorry, I'm kind of noob and I don't understand what you mean or how to do that.

User avatar
shin.e.d
Newbie
Posts: 12
Joined: Sat Jan 10, 2015 10:50 am
Projects: unnamed bxb game with dinosaurs!
Tumblr: shin-e-d
Contact:

Re: Choices in columns instead of rows?

#4 Post by shin.e.d » Sun Jul 30, 2017 1:28 am

Hi. :3 You can do that by putting
box_wrap
and ymaximum into the choice menu in screens.rpy. Like this...

Choice menu with columns example:

Code: Select all

screen choice(items):
    style_prefix "choice"

    vbox:

        ## wrap around into columns or rows depending on if it's in vbox or hbox.
        box_wrap True

        ## ymaximum is used for vertical box wrap.
        ## It includes the size of your button + spacing.
        ## To make things easier I just put the gui variables in.
        ## it normally looks something like this: ymaximum 100
        ## the *number at the end changes how many buttons are in the column.
        ## if nonetype error make sure the gui.choice variables are defined.
        ymaximum (gui.choice_button_height + gui.choice_spacing) *3
        for i in items:
            textbutton i.caption action i.action

## This overwrites the variables in gui.rpy when put in screens.rpy
define gui.choice_button_width = 350
define gui.choice_button_height = 50
define gui.choice_button_text_xalign = 0.0
define gui.choice_spacing = 0


Post Reply

Who is online

Users browsing this forum: vitorfgd