Is it possible to put images on the 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
Sirachi
Newbie
Posts: 2
Joined: Fri Jun 27, 2014 5:17 am
Contact:

Is it possible to put images on the main menu?

#1 Post by Sirachi »

I've done quite a bit of looking around but couldn't find anything about this. There was stuff about imagemaps and imagebuttons and what not but I could not dig up anything about this for the life of me.

Simply using:

Code: Select all

show image
Just returns an error and I couldn't find anything in the manual about it. I'd just like to add a small 2 frame animates image in the corner of the title screen. I could opt to just go unanimated and make it part of the background image but I wanted to know if could do it properly first.

User avatar
fluxus
Regular
Posts: 133
Joined: Thu Jun 19, 2014 8:06 am
Projects: Animal Anaesthesia (a teaching game)
Contact:

Re: Is it possible to put images on the main menu?

#2 Post by fluxus »

Usually you'd use

Code: Select all

image bg klinik = "img/bg_klinik.jpg"
scene bg klinik
with fade
for background images (although the main menu's background is added elsewhere - options.rpy I think)

and

Code: Select all

image tiger = "img/tiger.png"
show tiger
for character images, or objects.

Does that help?

I'd like to do something similar as what you write about at one point, but I'm unsure as to where the right section to add the code is.. I haven't really looked into it :]

Edit: @Donmai, Cool, that's going to help me as well when the time comes - Thanks ^.^
Last edited by fluxus on Fri Jun 27, 2014 5:28 pm, edited 1 time in total.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Is it possible to put images on the main menu?

#3 Post by Donmai »

You can change the background of the main menu by editing a line in options.rpy

Code: Select all

mm_root = "#594f4f", #change it to something like mm_root = "yourImageName.jpg",
# (the comma at the end of the line is very important!)
If you want to add more images, like an animated logo, you will have to, well, add it on screens.rpy:

Code: Select all

screen main_menu:

    tag menu

    window:
        style "mm_root"
    add "my_logo"
For this to work you must have the image defined elsewhere. This is usually done at the start of script.rpy, just to keep things organized:

Code: Select all

    image my_logo:
        "my_logo.png"
        offscreenleft
        alpha 0.0
        easein 1.0 xalign 0.5 alpha 1.0
(If my code isn't wrong your logo should enter screen from the left and stop in the middle of the screen).
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Sirachi
Newbie
Posts: 2
Joined: Fri Jun 27, 2014 5:17 am
Contact:

Re: Is it possible to put images on the main menu?

#4 Post by Sirachi »

Donmai wrote:You can change the background of the main menu by editing a line in options.rpy

Code: Select all

mm_root = "#594f4f", #change it to something like mm_root = "yourImageName.jpg",
# (the comma at the end of the line is very important!)
If you want to add more images, like an animated logo, you will have to, well, add it on screens.rpy:

Code: Select all

screen main_menu:

    tag menu

    window:
        style "mm_root"
    add "my_logo"
For this to work you must have the image defined elsewhere. This is usually done at the start of script.rpy, just to keep things organized:

Code: Select all

    image my_logo:
        "my_logo.png"
        offscreenleft
        alpha 0.0
        easein 1.0 xalign 0.5 alpha 1.0
(If my code isn't wrong your logo should enter screen from the left and stop in the middle of the screen).
Yup! This works. I did try using add as opposed to image/show but it seems the picture always showed beneath my imagemap for the menu which took up the whole screen.

Thanks a bunch!

User avatar
kisa
Veteran
Posts: 384
Joined: Sat Aug 27, 2011 7:08 pm
Completed: Brother Rose, Dogs Alone
Projects: So many projects, I can't name them.
Deviantart: tsubasafan135
Skype: Discord: Kisaofbishies#6680
itch: kisa
Contact:

Re: Is it possible to put images on the main menu?

#5 Post by kisa »

Pardon me... When I do what Donmai says to do... it tells me that my image isn't defined. (Even though I defined it in script.rpy)
Is this because it's screen language or am I being a dunce and forgetting something?
I'm offering commissions!
viewtopic.php?f=62&t=41656

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Is it possible to put images on the main menu?

#6 Post by Asceai »

Make sure you put the image name in quotes when referencing it in screen language.

e.g.

Code: Select all

image picture = "testing image.png"

Code: Select all

screen test:
    add "picture"

User avatar
kisa
Veteran
Posts: 384
Joined: Sat Aug 27, 2011 7:08 pm
Completed: Brother Rose, Dogs Alone
Projects: So many projects, I can't name them.
Deviantart: tsubasafan135
Skype: Discord: Kisaofbishies#6680
itch: kisa
Contact:

Re: Is it possible to put images on the main menu?

#7 Post by kisa »

Ah, so I was being a dunce.
Thank you, Asceai. OuOb
I'm offering commissions!
viewtopic.php?f=62&t=41656

Post Reply

Who is online

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