Editting MM button positions and click sound

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
TheSecretBear
Newbie
Posts: 4
Joined: Wed May 31, 2017 9:21 am
Contact:

Editting MM button positions and click sound

#1 Post by TheSecretBear »

So I'm having a bit of an issue with regards to menu editing. I imagine the button positioning issue may be solved once I add my own personal buttons in (waiting on my illustrator), but for now I see now way of moving the custom gui buttons on the main menu to be more center screen.

I am also having some issues with setting the click sound for the buttons.
I try the line (style.button.activate_sound = "main_menu_click.ogg") in options.py, but get no results.

I am using the new GUI interface for all of this.

Most guides I have found on these topics are fairly outdated.

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: Editting MM button positions and click sound

#2 Post by Scribbles »

you could try xpos and ypos to move the button where you want it? I'm not sure about the sound issues you're having though.
Image - Image -Image

TheSecretBear
Newbie
Posts: 4
Joined: Wed May 31, 2017 9:21 am
Contact:

Re: Editting MM button positions and click sound

#3 Post by TheSecretBear »

Scribbles wrote:you could try xpos and ypos to move the button where you want it? I'm not sure about the sound issues you're having though.
I figured I could use that once I actually put in my own buttons, but for now I can't seem to get that to happen with the built in new gui menu buttons, and to be fair my understanding of those is fairly lacking.
This is what I have for the main menu code in the screens.py

Code: Select all

screen main_menu():

    ## This ensures that any other menu screen is replaced.
    tag menu

    style_prefix "main_menu"

    add gui.main_menu_background

    ## This empty frame darkens the main menu.
    frame:
        pass

    ## The use statement includes another screen inside this one. The actual
    ## contents of the main menu are in the navigation screen.
    use navigation

    if gui.show_name:

        vbox:
            text "[config.name!t]":
                style "main_menu_title"

            text "[config.version]":
                style "main_menu_version"


style main_menu_frame is empty
style main_menu_vbox is vbox
style main_menu_text is gui_text
style main_menu_title is main_menu_text
style main_menu_version is main_menu_text

style main_menu_frame:
    xsize 420
    yfill True

    background "gui/overlay/main_menu.png"

style main_menu_vbox:      #CHANGING xalign AND yalign HERE DOES NOTHING
    xalign 1.0
    xoffset -30
    xmaximum 1200
    yalign 1.0
    yoffset -30

style main_menu_text:
    properties gui.text_properties("main_menu", accent=True)

style main_menu_title:
    properties gui.text_properties("title")

style main_menu_version:
    properties gui.text_properties("version")

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: Editting MM button positions and click sound

#4 Post by Scribbles »

ETA: I just realized doing this will change where the nav screen is in the whole game! you may want to get rid of the "use navigation" line and then manually add text buttons where you want them instead in the main menu! sorry > <

oh, those text buttons are in the navigation screen code, the main menu just adds them to itself (it says use navigation). If you change the xpos and ypos of the text buttons there, and remove the side frame it can work (I'm sorry I'm not super knowledgeable about code)

Code: Select all

screen navigation():

    vbox:
        style_prefix "navigation"

        xpos gui.navigation_xpos #### OR change the pos here maybe?
        yalign 0.5

        spacing gui.navigation_spacing

###### xpos and ypos after these text buttons should change what you're wanting them too ##################

        if main_menu:

            textbutton _("Start") action Start()

        else:

            textbutton _("History") action ShowMenu("history") 

            textbutton _("Save") action ShowMenu("save")

        textbutton _("Load") action ShowMenu("load")

        textbutton _("Preferences") action ShowMenu("preferences")

        if _in_replay:

            textbutton _("End Replay") action EndReplay(confirm=True)

        elif not main_menu:

            textbutton _("Main Menu") action MainMenu()

        textbutton _("About") action ShowMenu("about")

        if renpy.variant("pc"):

            ## Help isn't necessary or relevant to mobile devices.
            textbutton _("Help") action ShowMenu("help")

            ## The quit button is banned on iOS and unnecessary on Android.
            textbutton _("Quit") action Quit(confirm=not main_menu)
Then you'll just need to remove the side frame while may just taking some playing around in the nav screen
Image - Image -Image

TheSecretBear
Newbie
Posts: 4
Joined: Wed May 31, 2017 9:21 am
Contact:

Re: Editting MM button positions and click sound

#5 Post by TheSecretBear »

Ah, thank you very much. That worked for me. I should have looked over the screens.py a bit more, but I'm still fairly new to it all.
Now I just need a way to add the clicking sound in.

Post Reply

Who is online

Users browsing this forum: Ocelot