Center the title 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
Twar3Draconis
Regular
Posts: 129
Joined: Thu Apr 19, 2007 12:07 am
Location: Michigan, United States, Terra
Contact:

Center the title menu...

#1 Post by Twar3Draconis »

How would I center the menu at the title screen? It looked easy from the options.rpy file, but I was getting errors using those.

Code: Select all

        $ style.mm_menu_frame.xpos = 0.5
        $ style.mm_menu_frame.xanchor = 0.5
        $ style.mm_menu_frame.ypos = 0.75
        $ style.mm_menu_frame.yanchor = 0.5
I get:

Code: Select all

SyntaxError: invalid syntax (line 133)
Is there another method to center the title screen menu?

EDIT: This is in the Options.rpy file.

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#2 Post by monele »

Really not sure but maybe you don't need the "$" if it's in a python block?

Twar3Draconis
Regular
Posts: 129
Joined: Thu Apr 19, 2007 12:07 am
Location: Michigan, United States, Terra
Contact:

#3 Post by Twar3Draconis »

I had previously attempted that, but ended up with similar results.

c.s.marshall
Newbie
Posts: 18
Joined: Wed Apr 11, 2007 2:44 pm
Location: Dortmund, Germany
Contact:

#4 Post by c.s.marshall »

Twar,

EITHER change your default options.rpy entry from:

Code: Select all

...
    # style.mm_menu_frame.xpos = 0.5
    # style.mm_menu_frame.xanchor = 0.5
    # style.mm_menu_frame.ypos = 0.75
    # style.mm_menu_frame.yanchor = 0.5
...
to the normal form (removing the '# ' in front of the lines):

Code: Select all

...
    style.mm_menu_frame.xpos = 0.5
    style.mm_menu_frame.xanchor = 0.5
    style.mm_menu_frame.ypos = 0.75
    style.mm_menu_frame.yanchor = 0.5
...
exclusive OR (in the INIT section of your game code) include:

Code: Select all

...
    $ style.mm_menu_frame.xpos = 0.5
    $ style.mm_menu_frame.xanchor = 0.5
    $ style.mm_menu_frame.ypos = 0.75
    $ style.mm_menu_frame.yanchor = 0.5
...
Don't get them confused or even mix forms (like using the $-version in the options.rpy file). Remember that every default setting you (re)define in your INIT section overrides your options.rpy file anyway. I personally never use or change the options.rpy; I set everything I need in the game script simply to avoid confusing myself ;-)
---
Chris

Twar3Draconis
Regular
Posts: 129
Joined: Thu Apr 19, 2007 12:07 am
Location: Michigan, United States, Terra
Contact:

#5 Post by Twar3Draconis »

Thanks! I tried what you did, execpt in a new *.rpy and it worked.

Post Reply

Who is online

Users browsing this forum: AWizardWithWords, Bing [Bot], piinkpuddiin