Moving first menu to the middle

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
User avatar
Mikan
Veteran
Posts: 364
Joined: Sun Dec 23, 2007 12:20 am
Contact:

Moving first menu to the middle

#1 Post by Mikan » Sun Dec 23, 2007 2:31 am

Nevermind, problem solved! Thanks Pytom

Hello,
I've only begun playing around with renpy exploring what is possible with it and have come to my first obsticle.
I want to place the main menu in the center of the window instead of on the right as it appears by default.
How do I do this?

I tried messing around with this part in options.py

Code: Select all

        ## This lets you change the placement of the main menu.
        
        ## The way placement works is that we find an anchor point
        ## inside a displayable, and a position (pos) point on the
        ## screen. We then place the displayable so the two points are
        ## at the same place.

        ## An anchor/pos can be given as an integer or a floating point
        ## number. If an integer, the number is interpreted as a number
        ## of pixels from the upper-left corner. If a floating point,
        ## the number is interpreted as a fraction of the size of the
        ## displayable or screen.

        # 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
but the game stopped working once I uncommented the last four lines of that section as practice:

Code: Select all

I'm sorry, but an exception occured while executing your Ren'Py
script.

SyntaxError: invalid syntax (line 133)

While compiling python block starting at line 11 of C:\programs\renpy-6.3.3\nda/game/options.rpy.

-- Full Traceback ------------------------------------------------------------

  File "C:\Documents and Settings\mini\Desktop\renpy-6.3.3\renpy\bootstrap.py", line 209, in bootstrap
  File "C:\Documents and Settings\mini\Desktop\renpy-6.3.3\renpy\main.py", line 186, in main
  File "C:\Documents and Settings\mini\Desktop\renpy-6.3.3\renpy\script.py", line 444, in load_script
  File "C:\Documents and Settings\mini\Desktop\renpy-6.3.3\renpy\script.py", line 167, in __init__
  File "C:\Documents and Settings\mini\Desktop\renpy-6.3.3\renpy\script.py", line 344, in load_file
  File "C:\Documents and Settings\mini\Desktop\renpy-6.3.3\renpy\script.py", line 397, in update_bytecode
  File "C:\Documents and Settings\mini\Desktop\renpy-6.3.3\renpy\python.py", line 206, in py_compile_exec_bytecode
  File "C:\Documents and Settings\mini\Desktop\renpy-6.3.3\renpy\python.py", line 188, in py_compile
  File "compiler\transformer.pyo", line 50, in parse
  File "compiler\transformer.pyo", line 120, in parsesuite
SyntaxError: invalid syntax (line 133)

While compiling python block starting at line 11 of C:\programs\renpy-6.3.3\nda/game/options.rpy.

Ren'Py Version: Ren'Py 6.3.3a
Attached is an image of what I would like to achieve.
Attachments
menufix.jpg

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Moving first menu to the middle

#2 Post by PyTom » Sun Dec 23, 2007 2:46 am

The problem was that Mikan only removed the #, but not the space following them. When she removed it, it started working.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

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

Re: Moving first menu to the middle

#3 Post by monele » Sun Dec 23, 2007 7:03 am

*stares at the blurry picture*.... is this original material? *_*

User avatar
Mikan
Veteran
Posts: 364
Joined: Sun Dec 23, 2007 12:20 am
Contact:

Re: Moving first menu to the middle

#4 Post by Mikan » Sun Dec 23, 2007 1:06 pm

Yes, it's my own work.

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

Re: Moving first menu to the middle

#5 Post by monele » Sun Dec 23, 2007 2:03 pm

Looks good ^__^... (well, in a I-forgot-my-glasses kind of way, but still! :) )

User avatar
rocket
Veteran
Posts: 373
Joined: Tue Jul 10, 2007 2:54 am
Projects: Starlight Ep0, Ep1
Location: San Fransisco
Contact:

Re: Moving first menu to the middle

#6 Post by rocket » Thu Dec 27, 2007 12:02 pm

Mikan wrote:Yes, it's my own work.
DO WANT!

Very cute! Can't wait!

Post Reply

Who is online

Users browsing this forum: Google [Bot]