Page 1 of 1

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

Posted: Sat Oct 13, 2018 1:26 am
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 :)

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

Posted: Sat Oct 13, 2018 4:13 am
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.

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

Posted: Sat Oct 13, 2018 5:00 am
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

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

Posted: Sat Oct 13, 2018 10:04 am
by Nanahs
Thank so much guys! I'll give it a try! :)