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.
Noire
Regular
Posts: 108 Joined: Sun Mar 10, 2013 3:06 am
Projects: Mirage Noir
Contact:
#1
Post
by Noire » Tue Jul 29, 2014 11:14 am
Hello,
My problem is similar to the one submited in this topic:
Quit prompt from Main Menu (When I quit game from main menu via 'x' button I get YesNo prompt with checkered background.)
However, when I applied this fix the result was that it only showed the background and nothing else
(YesNo prompt didn't appear).
I tried changing mm_root and gm_root and it didn't work either. Here's the part of my Yes/No screen code:
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 'yesno.png' # Background image
idle 'yesno_idle.png'
hover 'yesno_hover.png'
hotspot (382, 270, 80, 60) action yes_action
hotspot (540, 270, 70, 60) action no_action
if message == layout.ARE_YOU_SURE:
add "yesno_are_you_sure.png.png"
elif message == layout.DELETE_SAVE:
add "yesno_delete_save.png"
elif message == layout.OVERWRITE_SAVE:
add "yesno_overwrite_save.png"
elif message == layout.LOADING:
add "yesno_loading.png"
elif message == layout.QUIT:
add "yesno_quit.png"
if main_menu:
add "black_1.jpg"
elif message == layout.MAIN_MENU:
add "yesno_main_menu.png"
Maybe something else is wrong and it prevents me from setting the desired background? I really don't know what else I can do here.
Thanks for your help
Last edited by
Noire on Tue Jul 29, 2014 11:38 am, edited 1 time in total.
Asceai
Eileen-Class Veteran
Posts: 1258 Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:
#2
Post
by Asceai » Tue Jul 29, 2014 11:32 am
That's because you're adding it too late and it's going on top of everything. Do the if / add background stuff before the imagemap.
Noire
Regular
Posts: 108 Joined: Sun Mar 10, 2013 3:06 am
Projects: Mirage Noir
Contact:
#3
Post
by Noire » Tue Jul 29, 2014 11:35 am
Thank you!
It helped and everything works fine
Whole code with correct order for people who might have trouble with this in the future:
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
if main_menu:
add "black_1.jpg"
imagemap:
ground 'yesno.png' # Background image
idle 'yesno_idle.png'
hover 'yesno_hover.png'
hotspot (382, 270, 80, 60) action yes_action
hotspot (540, 270, 70, 60) action no_action
if message == layout.ARE_YOU_SURE:
add "yesno_are_you_sure.png.png"
elif message == layout.DELETE_SAVE:
add "yesno_delete_save.png"
elif message == layout.OVERWRITE_SAVE:
add "yesno_overwrite_save.png"
elif message == layout.LOADING:
add "yesno_loading.png"
elif message == layout.QUIT:
add "yesno_quit.png"
elif message == layout.MAIN_MENU:
add "yesno_main_menu.png"
Users browsing this forum: Bing [Bot] , Ocelot