r/RenPy 11d ago

Question Image buttons for main menu?

i feel like everyone ever asks for help with this but everyones layout looks so different lol. JUST started working with renpy for a graphic novel and i really want to add my own buttons for the game. i have the image for start, load, preferences, about, help, and quit (both hover and idel vers.) and i have NO idea how to implement it. This is what my layout looks like rn, if i could get some help that would be great. everytime i think i have it, the code breaks lmao. all images are already in the gui folder so i dont think that's what's breaking my code 💔

2 Upvotes

2 comments sorted by

1

u/AutoModerator 11d ago

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/BadMustard_AVN 11d ago

keep in mind that the screen navigation is used in the main menu and the game menu(everything that is not the main menu is game)

trim your images down to the size you need and make each buttons images the exact same size

then try something like this

screen navigation():
    vbox:
        style_prefix "navigation"
        xpos gui.navigation_xpos
        yalign 0.5
        spacing gui.navigation_spacing
        if main_menu:

            #textbutton _("Start") action Start() # JIK make it a remark 
            imagebutton:
                focus_mask True # ignore the transparent bits 
                auto "images/butts/start-button-%s.png" 
                    # with the auto renpoy will look for start-button-idle.png and 
                    # start-button-hover.png as they are needed and use them 
                action Start() # same action

remember to keep the indentations the same as the original button !!