[Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainMenu

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
User avatar
Zelika
Newbie
Posts: 7
Joined: Mon Nov 04, 2013 11:01 pm
Projects: Blind
IRC Nick: ValerieXarichi
Location: Philippines
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#31 Post by Zelika »

Thank you sooo much for this tutorial!! It really helped me in my game :D

But I have a question, can I use a video as the background on my main menu? because I really love to use that on my game.

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#32 Post by OokamiKasumi »

Zelika wrote:Thank you sooo much for this tutorial!! It really helped me in my game :D
Excellent! I love being helpful. :)
Zelika wrote:...can I use a video as the background on my main menu? because I really love to use that on my game.
Yes!
-- http://lemmasoft.renai.us/forums/viewto ... 65#p292740
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

User avatar
Zelika
Newbie
Posts: 7
Joined: Mon Nov 04, 2013 11:01 pm
Projects: Blind
IRC Nick: ValerieXarichi
Location: Philippines
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#33 Post by Zelika »

OokamiKasumi wrote:
Zelika wrote:Thank you sooo much for this tutorial!! It really helped me in my game :D
Excellent! I love being helpful. :)
Zelika wrote:...can I use a video as the background on my main menu? because I really love to use that on my game.
Yes!
-- http://lemmasoft.renai.us/forums/viewto ... 65#p292740
Thank youuuuuuuuuuuuuu !!

I didn't knew this topic was there, anyways thanks as always ^^

User avatar
Sensata
Newbie
Posts: 11
Joined: Mon Oct 28, 2013 1:48 am
Projects: Mark of the goddess
Location: Doomlands
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#34 Post by Sensata »

OokamiKasumi wrote: You didn't do anything wrong.
-- This tutorial only covers changing the Backgrounds. :)

If you want to change the buttons and other stuff, check out this tutorial:
[Tutorial] Customizing Menus It comes with a sample game with fully working code too!
And this tutorial:
[Tutorial] Crash course in screen language/UI design
Thank you, i'll take a look to that topic again.(:

User avatar
Pinlin
Regular
Posts: 98
Joined: Fri Feb 08, 2013 9:33 am
Projects: Dark nights
Tumblr: darknightsblog
Deviantart: Pinlin
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#35 Post by Pinlin »

Thank you for this helpful tutorial! ^^
I got a little problem: I'm using an image map for the Yes/No menu and the hover image doesn't work for some reason.
This is my code:

Code: Select all

screen yesno_prompt:

   modal True

   on "show" action With(fade)
    
   modal True

   imagemap:
        ground "library/GUI/Blank.png"
        idle "library/GUI/menu_yes_no.png"
        hover "library/GUI/menu_yes_no_hover.png"
        
        hotspot (413,425,160,82) action yes_action
        hotspot (672,425,155,84) action no_action 

   #text _(message):
        #xalign 0.5
        #yalign 0.5

   if message == layout.ARE_YOU_SURE:
        add "library/GUI/menu_yes_no.png"
        
   elif message == layout.DELETE_SAVE:
        add "library/GUI/menu_yes_no.png"
        
   elif message == layout.OVERWRITE_SAVE:
        add "library/GUI/menu_yes_no.png"
        
   elif message == layout.LOADING:
        add "library/GUI/menu_yes_no.png"
        
   elif message == layout.QUIT:
        add "library/GUI/menu_yes_no.png"
        
   elif message == layout.MAIN_MENU:
        add "library/GUI/menu_yes_no.png"
I want all 6 menu's be the same. Do you know what I did wrong? >_<
Deviantart | Tumblr

Current project:

Image

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#36 Post by OokamiKasumi »

Pinlin wrote:Thank you for this helpful tutorial! ^^
I got a little problem: I'm using an image map for the Yes/No menu and the hover image doesn't work for some reason.
This is my code:

Code: Select all

   imagemap:
        ground "library/GUI/Blank.png"
        idle "library/GUI/menu_yes_no.png"
        hover "library/GUI/menu_yes_no_hover.png"
        
        hotspot (413, 425,160, 82) action yes_action
        hotspot (672, 425,155, 84) action no_action 

I want all 6 menu's be the same. Do you know what I did wrong? >_<
First, Check your Hover Image: menu_yes_no_hover.png
-- Is the image in the right folder? (GUI > inside of library > inside of GAME?)
-- Is the name of your hover image, and the name of the image in the above code -- the Same? One tiny space in the wrong place is enough.

Next, check your Hotspot codes:
-- Are you sure these coordinates are right?

Since it's a case of a missing graphic, the problem should be in one of the things listed above,.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

User avatar
Pinlin
Regular
Posts: 98
Joined: Fri Feb 08, 2013 9:33 am
Projects: Dark nights
Tumblr: darknightsblog
Deviantart: Pinlin
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#37 Post by Pinlin »

OokamiKasumi wrote:
Pinlin wrote:Thank you for this helpful tutorial! ^^
I got a little problem: I'm using an image map for the Yes/No menu and the hover image doesn't work for some reason.
This is my code:

Code: Select all

   imagemap:
        ground "library/GUI/Blank.png"
        idle "library/GUI/menu_yes_no.png"
        hover "library/GUI/menu_yes_no_hover.png"
        
        hotspot (413, 425,160, 82) action yes_action
        hotspot (672, 425,155, 84) action no_action 

I want all 6 menu's be the same. Do you know what I did wrong? >_<
First, Check your Hover Image: menu_yes_no_hover.png
-- Is the image in the right folder? (GUI > inside of library > inside of GAME?)
-- Is the name of your hover image, and the name of the image in the above code -- the Same? One tiny space in the wrong place is enough.

Next, check your Hotspot codes:
-- Are you sure these coordinates are right?

Since it's a case of a missing graphic, the problem should be in one of the things listed above,.
Thank you for the help, I'm sorry for the late reply.
The image is in the right folder and the naming is right. I tested them by replacing

Code: Select all

add "library/GUI/menu_yes_no.png"
with

Code: Select all

 add "library/GUI/menu_yes_no_hover.png"
The image just shows up. Though the problem is, when I hover it, it doesn't change. It is a indentation mismatch?
The hotspots are correct, because the buttons do work when I hit them.
I tried:

Code: Select all

screen yesno_prompt:

   modal True

   on "show" 
    
   modal True

   imagemap:
        ground "library/GUI/Blank.png"
        idle "library/GUI/menu_yes_no.png"
        hover "library/GUI/menu_yes_no_hover.png"
        
        hotspot (413,425,160,82) action yes_action
        hotspot (672,425,155,84) action no_action 

   #text _(message):
        #xalign 0.5
        #yalign 0.5

        if message == layout.ARE_YOU_SURE:
           add "library/GUI/menu_yes_no.png"
        
        elif message == layout.DELETE_SAVE:
           add "library/GUI/menu_yes_no.png"
        
        elif message == layout.OVERWRITE_SAVE:
           add "library/GUI/menu_yes_no.png"
        
        elif message == layout.LOADING:
           add "library/GUI/menu_yes_no.png"
        
        elif message == layout.QUIT:
           add "library/GUI/menu_yes_no.png"
        
        elif message == layout.MAIN_MENU:
           add "library/GUI/menu_yes_no.png"
but the hover image still doesnt show up.
Deviantart | Tumblr

Current project:

Image

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#38 Post by OokamiKasumi »

Pinlin wrote:...The image just shows up. Though the problem is, when I hover it, it doesn't change. It is a indentation mismatch?
The hotspots are correct, because the buttons do work when I hit them.
I tried:

Code: Select all

screen yesno_prompt:
   modal True

   on "show" 
    
   modal True

   imagemap:
        ground "library/GUI/Blank.png"
        idle "library/GUI/menu_yes_no.png"
        hover "library/GUI/menu_yes_no_hover.png"
        
        hotspot (413,425,160,82) action yes_action
        hotspot (672,425,155,84) action no_action 
but the hover image still doesnt show up.
That top part should look like this:

Code: Select all

screen yesno_prompt:
    on "show" action With(dissolve)
    modal True

    imagemap:
        ground "library/GUI/Blank.png"
        idle "library/GUI/menu_yes_no.png"
        hover "library/GUI/menu_yes_no_hover.png"
        
        hotspot (413,425,160,82) action yes_action
        hotspot (672,425,155,84) action no_action 
See if that works.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

User avatar
Pinlin
Regular
Posts: 98
Joined: Fri Feb 08, 2013 9:33 am
Projects: Dark nights
Tumblr: darknightsblog
Deviantart: Pinlin
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#39 Post by Pinlin »

Thanks for the help, but it didn't really work heh ^^''
I tried something else by deleting the "if and elif" statements. Also replacing the ground with the same image used in idle:

Code: Select all

# Yes/No Prompt
#
# Screen that asks the user a yes or no question.
# http://www.renpy.org/doc/html/screen_special.html#yesno-prompt
    
screen yesno_prompt:
     on "show" action With(dissolve)
     modal True
     
     imagemap:
        ground "library/GUI/menu_yes_no.png"
        idle "library/GUI/menu_yes_no.png"
        hover "library/GUI/menu_yes_no_hover.png"
        
        hotspot (413,425,160,82) action yes_action
        hotspot (672,425,155,84) action no_action 
This code works perfectly, the buttons do highlight when I hover it. I have no idea what was wrong with the previous code though...
Using this code displays the same "yes/no" screen in all options.
Deviantart | Tumblr

Current project:

Image

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#40 Post by OokamiKasumi »

Pinlin wrote:...Also replacing the ground with the same image used in idle...

Code: Select all

     
     imagemap:
        ground "library/GUI/menu_yes_no.png"
        idle "library/GUI/menu_yes_no.png"
        hover "library/GUI/menu_yes_no_hover.png"
        
        hotspot (413,425,160,82) action yes_action
        hotspot (672,425,155,84) action no_action 
If changing an image did the trick, then that image was somehow covering the Hover image. Even if it's transparent an image can still block out another image by rendering it invisible.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

User avatar
Ri Eaharuto
Newbie
Posts: 6
Joined: Thu Apr 17, 2014 7:59 am
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#41 Post by Ri Eaharuto »

Thank you very much^^ This really helps me out.

But I have a little problem. I did everything correct, but when I start the game I can only see the upper left corner of the background and can´t do anything.
What did I wrong?

Ri Eaharuto

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#42 Post by OokamiKasumi »

Ri Eaharuto wrote:Thank you very much^^ This really helps me out.

But I have a little problem. I did everything correct, but when I start the game I can only see the upper left corner of the background and can´t do anything.
What did I wrong?

Ri Eaharuto
Can you show me a screenshot?
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

User avatar
Clover0Project
Newbie
Posts: 15
Joined: Tue Jul 22, 2014 4:04 am
Location: Bandung, Indonesia
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#43 Post by Clover0Project »

Hello. Thank you so much for making this tutorial.
But I have a problem. I tried everything I can but it's no use.
First, I want to ask, for the yes/no text messages only, where to put the codes in the screen yes/no prompt? I'm afraid I put the codes in the wrong place. Also, it's suitable for the newest version of ren'py (6.18+) right? (some people has problems after updating.)
If I don't get it wrong...I copied the yes/no text messages only, it's all the same.
But, when I open my game, I got (I just wrote it here, it simple) this error:
label expects a non-empty block.
label _("Are you really sure?"):
<-

I wonder what is wrong...

EDIT: solved I don't know how just trying. Thanks!
Last edited by Clover0Project on Thu Dec 25, 2014 8:49 pm, edited 1 time in total.

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#44 Post by Alex »

You need to fix the indentation in your script - http://www.renpy.org/wiki/renpy/FAQ#How ... _blocks.3F

Loxxi
Newbie
Posts: 14
Joined: Thu Aug 15, 2013 7:17 pm
Projects: OPKHDS
Contact:

Re: [Tutorial]Custom Backgrounds:Save/Load/Pref/Yes-No/MainM

#45 Post by Loxxi »

Whoa, dude. ;_; Took me two freakin' years to actually find this. Either I'm blind and I never knew it, or I'm just lazier than I thought I was. xD Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users