[SOLVED] Changing Main Menu Buttons

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.
Message
Author
Aishra
Newbie
Posts: 20
Joined: Sat Dec 03, 2011 6:26 pm
Projects: My Fair Prince (Working Title)
Contact:

[SOLVED] Changing Main Menu Buttons

#1 Post by Aishra »

(I apologize for my noobiness in advance, considering this would be my first VN I ever made @o@;; I'm trying to search up solutions but I'm not quite sure what I'm finding is what I'm looking for...as you can tell I'm not very good at understanding programming either xD; .)

How do you change the default main menu buttons? Like, how would you be able to take out the whole blue button menu that's given to you by default and replace it with your own button images? Also, how would you position it? Do these things go in the options.rpy or screens.rpy?
Last edited by Aishra on Sun Feb 19, 2012 2:15 pm, edited 2 times in total.

User avatar
Nuxill
Veteran
Posts: 464
Joined: Sat Sep 25, 2010 4:50 pm
Projects: No Friend
Tumblr: nuxill
itch: nuxill
Contact:

Re: Needing quick assistance as soon as possible! D:

#2 Post by Nuxill »

I don't know if you've seen this but it should help you with all of your menu related needs. :o

Aishra
Newbie
Posts: 20
Joined: Sat Dec 03, 2011 6:26 pm
Projects: My Fair Prince (Working Title)
Contact:

Re: Needing quick assistance as soon as possible! D:

#3 Post by Aishra »

Nuxill wrote:I don't know if you've seen this but it should help you with all of your menu related needs. :o
I have, but I still don't quite understand it...so if I want to change my default, I just set up an image map? What if I wanted the text to glow when you hovered over it though? I make a duplicate image but with glowing text? I think I mostly just need clarification xDD

edit:
I don't know what I'm doing wrong. It says invalid syntax with 'imagemap:' with a red arrow pointing towards it. D:

Code: Select all

    imagemap:
        ground 'menunull.png'
        hover 'menuhover.png'
                hotspot (504, 356, 136, 26)action Start()
                hotspot (505, 400, 138, 30) action ShowMenu('load')
                hotspot (495, 446, 155, 33) action ShowMenu('preferences')
                hotspot (636, 472, 540, 353) action Help()
                hotspot (503, 497, 139, 31) action Quit(confirm=False)

User avatar
Nuxill
Veteran
Posts: 464
Joined: Sat Sep 25, 2010 4:50 pm
Projects: No Friend
Tumblr: nuxill
itch: nuxill
Contact:

Re: Needing quick assistance as soon as possible! D:

#4 Post by Nuxill »

Aishra wrote:
Nuxill wrote:I don't know if you've seen this but it should help you with all of your menu related needs. :o
I have, but I still don't quite understand it...so if I want to change my default, I just set up an image map? What if I wanted the text to glow when you hovered over it though? I make a duplicate image but with glowing text? I think I mostly just need clarification xDD
I'm pretty sure that's what you would do if you wanted that kind of thing. I haven't tried working with image maps yet so I might not be 100% accurate with my knowledge.

As for the code I'm not sure but you might need something for idle, selected_idle, and selected_hover images which you could just copy and paste what you have now. Something like this:

Code: Select all

imagemap:
        ground "menunull.png"
        idle "menunull.png"
        hover "menuhover.png"
        selected_idle "menunull.png"
        selected_hover "menuhover.png"

You might need the extra parts just for the main menu.
Also do you have

Code: Select all

window:
        style "gm_root"
before it? If not that might be a part of the problem too.

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: How to change the default main menu buttons? >.<

#5 Post by HigurashiKira »

^ Selected idle and selected hover are unessisary since it's the main menu. Just have ground, idle, and hover images.
Ill edit this post with my imagemap code (currently typing from my phone )

EDIT:

Code: Select all

imagemap:
        ground "mainmenu_idle.png"
        hover "mainmenu_hover.png"
      
        hotspot (585,278,54,22) action Start()
        hotspot (100,155,94,22) action ShowMenu("load")
        hotspot (100,107,78,22) action ShowMenu("preferences")
        hotspot (100,200,78,22) action ShowMenu("extras")
        hotspot (83,490,118,22) action Quit(confirm=False)   
You indented the hotspots wrong. It should be at level with your images.
I have moved to a new account. Please contact me here from now on. T/Y~

Aishra
Newbie
Posts: 20
Joined: Sat Dec 03, 2011 6:26 pm
Projects: My Fair Prince (Working Title)
Contact:

Re: How to change the default main menu buttons? >.<

#6 Post by Aishra »

Alright. Here's my code now:

Code: Select all

window:
        style "gm_root"
imagemap:
        ground 'menunull.png'
        hover 'menuhover.png'

        hotspot (504, 356, 136, 26)action Start()
        hotspot (505, 400, 138, 30) action ShowMenu('load')
        hotspot (495, 446, 155, 33) action ShowMenu('preferences')
        hotspot (503, 497, 139, 31) action Quit(confirm=False)
However now it says that parsing the script failed. On the error screen it says:

Code: Select all

File "game/options.rpy", line 267: expected statement.
     window->:
File "game/options.rpy", line 269: expected statement.
     imagemap->:
Last edited by Aishra on Fri Feb 17, 2012 9:22 pm, edited 1 time in total.

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: How to change the default main menu buttons? >.<

#7 Post by HigurashiKira »

Get rid of the window since you're using an magemap, and add 4 spaces behind imagemap
Image
I have moved to a new account. Please contact me here from now on. T/Y~

Aishra
Newbie
Posts: 20
Joined: Sat Dec 03, 2011 6:26 pm
Projects: My Fair Prince (Working Title)
Contact:

Re: How to change the default main menu buttons? >.<

#8 Post by Aishra »

Did that just now. Code remains the same except with the window part deleted. And the imagemap part is indented 4 spaces of course. Unfortunately now, it says:

Code: Select all

File "game/options.rpy", line 267: invalid syntax"
    imagemap:<-

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: How to change the default main menu buttons? >.<

#9 Post by HigurashiKira »

Mind if you send me a copy of your screens.rpy?
I have moved to a new account. Please contact me here from now on. T/Y~

Aishra
Newbie
Posts: 20
Joined: Sat Dec 03, 2011 6:26 pm
Projects: My Fair Prince (Working Title)
Contact:

Re: How to change the default main menu buttons? >.<

#10 Post by Aishra »

Oh geez. How stupid am I...I had the code in options.rpy. >___<;;; Put it in screens.rpy and now the code itself is working! Thanks xD;;

More problems though...when I hover over the image, it doesn't change as I want it to...it just remains static.

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: How to change the default main menu buttons? >.<

#11 Post by HigurashiKira »

Odd, should have worked. Could you attach your menuhover?
I have moved to a new account. Please contact me here from now on. T/Y~

Aishra
Newbie
Posts: 20
Joined: Sat Dec 03, 2011 6:26 pm
Projects: My Fair Prince (Working Title)
Contact:

Re: How to change the default main menu buttons? >.<

#12 Post by Aishra »

Here is the idle version and the hover version. Technically the idle version doesn't work either, since I have to put the idle image on the game background in order for it to even appear.
Attachments
menunull.png
menuhover.png

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: How to change the default main menu buttons? >.<

#13 Post by HigurashiKira »

I just tested the menu out using your coordinates and images, and it should have worked.
Did you erase

Code: Select all

window:
        style "gm_root"
If not, do so because I recreated your wrror wqhen I left that in tact.
I have moved to a new account. Please contact me here from now on. T/Y~

Aishra
Newbie
Posts: 20
Joined: Sat Dec 03, 2011 6:26 pm
Projects: My Fair Prince (Working Title)
Contact:

Re: How to change the default main menu buttons? >.<

#14 Post by Aishra »

Hmm. I did that, it's still not working. Is it something about setting the background image on options.rpy to the idle image? Or does that not matter?

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: How to change the default main menu buttons? >.<

#15 Post by HigurashiKira »

Add these two files into your directory and tell me if it works. (You might have to recustomize your GUI if you've messed around with anything else besides the MM)
Attachments
options.rpy
(8.36 KiB) Downloaded 120 times
screens.rpy
screens file
(14.41 KiB) Downloaded 115 times
I have moved to a new account. Please contact me here from now on. T/Y~

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]