[solved] Is it possible to make a menu of options like that?

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
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

[solved] Is it possible to make a menu of options like that?

#1 Post by Nanahs »

There's a part of my game where the background would be something like this:

Image

I want to know if it's possible to make a menu options that would be inside the pink square. Also, with a lateral bar to scroll down. Like this:

Image

It's not the main menu. It's just a label, part of the game.

To make it clear hah
I want to know if can I can estabilish where the menu should start (on the screen) and the limit. The position. And if there could be a bar to scroll down and see all the options. Like in the picture.

Am I asking too much? (I probably am hah)

Is it possible do make? Or you can't edit the menu like that?
It would be this way only for this label, like a special menu.

Thanks :)
Last edited by Nanahs on Sun Oct 14, 2018 10:22 am, edited 1 time in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Is it possible to make a menu of options like that?

#2 Post by Imperf3kt »

You can achieve this with a vpgrid. Look at the "game menu" screen for a working example. You'll need to copy it and edit it to use values you come up with or make your own.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Is it possible to make a menu of options like that?

#3 Post by Alex »

Yes, you can edit the choice screen the way you like. Since you don't need all the choices to look like that, just make a flag variable to change menu appearence and edit the choice screen like

Code: Select all

screen choice(items):
    
    if not flag: #<--- default menu
        style_prefix "choice"

        vbox:
            for i in items:
                textbutton i.caption action i.action
                
    else: #<--- custom menu
        frame:
            pos (x, y)
            side "c b r":
                area (0, 0, w, h) #(100, 100, 600, 400)

                viewport id "vp":
                    draggable True

                    vbox:
                        for i in items:
                            textbutton i.caption action i.action

                bar value XScrollValue("vp")
                vbar value YScrollValue("vp")
Then in game

Code: Select all

default flag = False

label start:    
    "..."
    menu:
        "Normal menu"
        "Choice 1":
             pass
        "Choice 2":
             pass
        "Choice 3":
             pass
    
    "... ..."
    $ flag, x, y, w, h = True, 800, 200, 150, 300
    
    menu:
        "Custom menu"
        "Choice 1":
             pass
        "Choice 2":
             pass
        "Choice 3":
             pass
        "Choice 4":
             pass
        "Choice 5":
             pass
        "Choice 6":
             pass
        "Choice 7":
             pass
        "Choice 8":
             pass
        "Choice 9":
             pass
        "Choice 1":
             pass
        "Choice 2":
             pass
        "Choice 3":
             pass
        "Choice 4":
             pass
        "Choice 5":
             pass
        "Choice 6":
             pass
        "Choice 7":
             pass
        "Choice 8":
             pass
        "Choice 9":
             pass
    "?"
    
    $ flag = False
    
    menu:
        "Normal menu 2"
        "Choice 1":
             pass
        "Choice 2":
             pass
        "Choice 3":
             pass
    
    "?!"
You might need to rename variables (flag, x, y, w, h) to not let them reassign yours

https://www.renpy.org/doc/html/screens.html#
https://www.renpy.org/doc/html/screens.html#frame
https://www.renpy.org/doc/html/screens.html#viewport

User avatar
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Re: Is it possible to make a menu of options like that?

#4 Post by Nanahs »

Thank so much guys! I'll give it a try! :)

Post Reply

Who is online

Users browsing this forum: Google [Bot]