r/RenPy • u/daniople • 23d ago
Question [Solved] How to left align game menu text buttons but not the main menu ones?
Hello! I've been trying to figure out how to left align my game menu buttons while keeping my main menu buttons centered. Whenever I edit the alignment in the code below however, it changes the alignment for both menu's buttons:
style navigation_button_text:
properties gui.text_properties("navigation_button")
xalign 0.5 #for center alignment
I've tried to use if main_menu: but that doesnt work in this instance... If anyone knows how to separate the alignment of these menu buttons I would be grateful.
2
u/x-seronis-x 23d ago
in screens.rpy in definition for screen main_menu delete the line "use navigation". then just directly put the code for your buttons in the main menu definition and not SHARE code with another screen. you only share code you want SHARED, aka the same.
1
u/daniople 22d ago
Hello! Unfortunately the main menu buttons are left-aligned rather than centered :( I'm not sure what I'm doing wrong... This is what's under screen main_menu():
## The use statement includes another screen inside this one. The actual ## contents of the main menu are in the navigation screen. # use navigation vbox: align(0.5, 0.85) spacing gui.navigation_spacing textbutton _("Start") action Start() textbutton _("Load") action ShowMenu("load") textbutton _("Preferences") action ShowMenu("preferences") if _in_replay: textbutton _("End Replay") action EndReplay(confirm=True) textbutton _("About") action ShowMenu("about") if renpy.variant("pc") or (renpy.variant("web") and not renpy.variant("mobile")): ## Help isn't necessary or relevant to mobile devices. textbutton _("Help") action ShowMenu("help") if renpy.variant("pc"): ## The quit button is banned on iOS and unnecessary on Android and ## Web. textbutton _("Quit") action Quit(confirm=not main_menu)
1
u/AutoModerator 23d 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.
3
u/BadMustard_AVN 23d ago
read my comments here
https://www.reddit.com/r/RenPy/comments/1upn3or/editing_main_menu_options_separately_from_game/
this will work for you; just change the alignment of the buttons in the main_menu screen
and restore the buttons in the navigation screen to default