Question about Main Menu Customization (SOLVED)

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
CoffeeGamer
Newbie
Posts: 4
Joined: Wed Jun 24, 2015 1:26 pm
Contact:

Question about Main Menu Customization (SOLVED)

#1 Post by CoffeeGamer » Wed Jun 24, 2015 1:31 pm

Hello, everybody!
I am trying to build highly customized Visual Novel. But I met a problem that probably has an easy fix. Can somebody tell me how can I change the size of the menu in the Main Menu Screen? I figured out how to change, the text, the color and the position, but not the size.
Thanks in advance to everybody! :)
Last edited by CoffeeGamer on Thu Jun 25, 2015 1:13 pm, edited 1 time in total.

HiddenCreature
Regular
Posts: 178
Joined: Sat May 16, 2015 8:00 pm
Projects: Vampire: The New Birth
Contact:

Re: Question about Main Menu Customization

#2 Post by HiddenCreature » Wed Jun 24, 2015 3:14 pm

It should be either in the screens.rpy file, or the options.rpy file under your project's game directory.

The #comments in the code should tell you what will adjust the size.

User avatar
CoffeeGamer
Newbie
Posts: 4
Joined: Wed Jun 24, 2015 1:26 pm
Contact:

Re: Question about Main Menu Customization

#3 Post by CoffeeGamer » Wed Jun 24, 2015 5:05 pm

Yes i already checked both screens.rpy and options.rpy thats how i was able to adjust things like the possitions and names of the menus but i just could not find the option to adjust the size of the main menu anywhere in options or screens.rpy to adjust the size of the buttons that is.

User avatar
Wetwetart
Newbie
Posts: 5
Joined: Wed Jun 24, 2015 5:19 am
Contact:

Re: Question about Main Menu Customization

#4 Post by Wetwetart » Wed Jun 24, 2015 10:32 pm

I just customized my main menu days ago. Maybe you can post up a screenshot of your main menu so we know what's going on and maybe, can help with my past experience. Cheers.

User avatar
A Hazard
Regular
Posts: 25
Joined: Sun Jun 29, 2014 4:02 pm
Completed: Gilded - The Lily & the Cage
Projects: Fragment - A Broken Fairy Tale
Tumblr: fragmentfairytale
Deviantart: fragmentfairytale
Contact:

Re: Question about Main Menu Customization

#5 Post by A Hazard » Thu Jun 25, 2015 12:22 am

If I understand you correctly, you want to adjust the basic textbuttons on the main menu screen (not creating an image map for it etc). To do that you'll want...

Code: Select all

init -2:

    style mm_button:
        xsize [insert-some-number]
        ysize [insert-some-number]
        xpadding [insert-some-number]
        ypadding [insert-some-number]
        xmargin [insert-some-number]
        ymargin [insert-some-number] 
You don't need to set numbers for all of those, but fiddling with them will give you different adjustments in size in various ways.

style mm_button is probably already coded in the init -2 block right below screen main_menu in screens.rpy. You just have to make sure to remove the size_group "mm" that's already there. And you can use style mm_button_text to style the overall appearance & size of the button text as well.

User avatar
CoffeeGamer
Newbie
Posts: 4
Joined: Wed Jun 24, 2015 1:26 pm
Contact:

Re: Question about Main Menu Customization

#6 Post by CoffeeGamer » Thu Jun 25, 2015 10:40 am

Here is a screenshot of the screens.rpy file of what i replaced the original code with, and the traceback log that occured when i tried to launch the game, i am probably just messing up something and making a nooby mistake... Thanks in advance!
Image

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
TypeError: unsupported operand type(s) for -: 'int' and 'RevertableList'

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

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 29, in script
    $ ui.interact()
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\ast.py", line 785, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\python.py", line 1448, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 29, in <module>
    $ ui.interact()
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\ui.py", line 277, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\display\core.py", line 2276, in interact
    repeat, rv = self.interact_core(preloads=preloads, **kwargs)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\display\core.py", line 2608, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\display\core.py", line 1717, in draw_screen
    renpy.config.screen_height,
  File "renpy/display/render.pyx", line 379, in renpy.display.render.render_screen (gen\renpy.display.render.c:5886)
    rv = render(root, width, height, 0, 0)
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen\renpy.display.render.c:2662)
    rv = d.render(widtho, heighto, st, at)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\display\layout.py", line 649, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen\renpy.display.render.c:3045)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen\renpy.display.render.c:2662)
    rv = d.render(widtho, heighto, st, at)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\display\layout.py", line 649, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen\renpy.display.render.c:3045)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen\renpy.display.render.c:2662)
    rv = d.render(widtho, heighto, st, at)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\display\layout.py", line 649, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen\renpy.display.render.c:3045)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen\renpy.display.render.c:2662)
    rv = d.render(widtho, heighto, st, at)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\display\screen.py", line 597, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen\renpy.display.render.c:3045)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen\renpy.display.render.c:2662)
    rv = d.render(widtho, heighto, st, at)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\display\layout.py", line 649, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen\renpy.display.render.c:3045)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen\renpy.display.render.c:2662)
    rv = d.render(widtho, heighto, st, at)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\display\layout.py", line 995, in render
    st, at)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen\renpy.display.render.c:3045)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen\renpy.display.render.c:2662)
    rv = d.render(widtho, heighto, st, at)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\display\layout.py", line 808, in render
    surf = render(d, width - x, rh, cst, cat)
  File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen\renpy.display.render.c:3045)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen\renpy.display.render.c:2662)
    rv = d.render(widtho, heighto, st, at)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\display\behavior.py", line 619, in render
    rv = super(Button, self).render(width, height, st, at)
  File "D:\Ren'Py\renpy-6.99.4-sdk\renpy\display\layout.py", line 993, in render
    width  - cxmargin - cxpadding,
TypeError: unsupported operand type(s) for -: 'int' and 'RevertableList'

Windows-7-6.1.7601-SP1
Ren'Py 6.99.4.467

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Question about Main Menu Customization

#7 Post by trooper6 » Thu Jun 25, 2015 12:11 pm

The numbers should be without brackets.
So:

Code: Select all

style mm_button:
    xsize 300
    ysize 200
Note: 1 is a really small number--it is one pixel! You make it that small and you won't see those buttons at all! If your game is at the default size of 800x600, then an xsize of 400 would be half the width of your screen.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
CoffeeGamer
Newbie
Posts: 4
Joined: Wed Jun 24, 2015 1:26 pm
Contact:

Re: Question about Main Menu Customization

#8 Post by CoffeeGamer » Thu Jun 25, 2015 1:13 pm

Thanks to all of you! You have all been of much help ! It worked :P

Post Reply

Who is online

Users browsing this forum: Bing [Bot]