how to change position of buttons in main menu?

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
TamakiShibo
Regular
Posts: 27
Joined: Sat Jul 07, 2018 1:24 pm
Contact:

how to change position of buttons in main menu?

#1 Post by TamakiShibo »

how to change position of buttons in main menu? i know i should change something in screens.rpy but i dont understand anything there. i just want to move main menu buttons from left to center of the screen

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: how to change position of buttons in main menu?

#2 Post by Per K Grok »

TamakiShibo wrote: Mon Aug 13, 2018 7:25 am how to change position of buttons in main menu? i know i should change something in screens.rpy but i dont understand anything there. i just want to move main menu buttons from left to center of the screen
find this code

Code: Select all

screen navigation():

    vbox:
        style_prefix "navigation"

        xpos gui.navigation_xpos
        yalign 0.5
        
You then change

xpos gui.navigation_xpos
to
xalign 0.5

Simple enough, BUT a problem with this is that it will put the navigation buttons in the middle of the page on all screens that use navigation buttons (load, save about and so on)
I don't think you want that.

Fixing that would probably be a bit of work.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: how to change position of buttons in main menu?

#3 Post by Imperf3kt »

The easy approach to that problem, is to copy the relevant textbuttons and styles from the navigation screen, place them in a center aligned vbox (or hbox) and remove 'use navigation' from the main menu screen
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: No registered users