Page 1 of 1

Make horizontal bar with left & right arrow buttons that scroll a hbox? (picture)

Posted: Sat Sep 08, 2018 5:35 pm
by henvu50
I made a picture of what I'm trying to achieve:

Image

There's an hbox with name labels in it. Then you click the left and right arrows, it cycles through the names while showing data of each name in the center.

Does anyone know an example somewhere out there already made that I can learn from?

Here is my code so far:

Code: Select all


screen test_screen:

    frame:
        background Solid("#00000090")
        align (0.5, 0.2)

        frame:
            background Solid("#00000090")
       
            hbox: 
                #LEFT ARROW BUTTON
                imagebutton:
                    idle "images/gui/arrowleftbtn.png" 
                # NAMES
                label "name1" 
                label "name2"
                label "name3"
                #RIGHT ARROW BUTTON
                imagebutton:
                    idle "images/gui/arrowrighttbtn.png"
             vbox:
                # based upon name show the following data
                text "data for nameX"

Re: Make horizontal bar with left & right arrow buttons that scroll a hbox? (picture)

Posted: Fri Sep 14, 2018 6:19 pm
by Qlara
Since no one posted a solution yet, you could try this:
Use the code from the Ren'Py example game's 'Help' screen. It has tabs at the top which you could rename to your names. Style them and add your arrows.
That's just an idea though if you can't find a better way.