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

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
henvu50
Regular
Posts: 88
Joined: Wed Aug 22, 2018 1:22 am
Contact:

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

#1 Post by henvu50 » Sat Sep 08, 2018 5:35 pm

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"

User avatar
Qlara
Regular
Posts: 80
Joined: Fri Nov 28, 2014 10:22 am
Completed: Carmilla
Skype: kantonija
itch: visualgothic
Location: Berlin
Contact:

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

#2 Post by Qlara » Fri Sep 14, 2018 6:19 pm

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.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Danah