Main Menu image
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.
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.
Main Menu image
Hello
I want to change main menu image after end of the game (simple, not miltiple choice)
Thanks in advance!
I want to change main menu image after end of the game (simple, not miltiple choice)
Thanks in advance!
of the people for the people
Re: Main Menu image
Code: Select all
#script.rpy:
label start:
"Change background in direct dependence from endings."
menu:
"First.":
$ persistent.ending = "first"
"Second.":
$ persistent.ending = "second"
"To return the main background.":
$ persistent.ending = "main"
return
#screens.rpy:
screen main_menu:
# This replaces the other menu
tag menu
# The main menu background.
window:
style "mm_root"
if persistent.ending == None:
$ persistent.ending = "main"
background ("images/mm-%s.jpg" % (persistent.ending))
# etc.
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: Main Menu image
Code: Select all
default persistent.endings_found = []
init python:
gui.main_menu_background = "images/bg {0}.png".format( len(persistent.endings_found) )
label some_ending:
if 1 not in persistent.endings_found:
persistent.endings_found.append( 1 )
label some_other_ending:
if 2 not in persistent.endings_found:
persistent.endings_found.append( 2 )
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
- Draziya
- Regular
- Posts: 70
- Joined: Sun Nov 26, 2017 8:50 am
- Completed: this was for you. [NaNoRenO 19], Acetylene [AceJam19], Ah!! My Roommate is a Succubus Hellbent on World [MonJam 18], I Don't Have A Clue [QRMJam 18], Cautionary Tale [NaNoRenO 18], OP Dodge Cross [GGJ 18], Acetone [AceJam 18]
- Projects: I'm a love interest in my childhood friend's reverse harem!!
- Organization: Watercress
- itch: Drazillion
- Contact:
Re: Main Menu image
I notice that you mentioned your game doesn't have multiple choices. This is what I did for a kinetic VN I did.
At the end of the game I added a persistent variable.
I added an if statement with that persistent variable in the game_menu in screens.rpy.
At the end of the game I added a persistent variable.
Code: Select all
label end:
"THE END"
$ persistent.end = 1
I added an if statement with that persistent variable in the game_menu in screens.rpy.
Code: Select all
screen game_menu(title, scroll=None, yinitial=0.0):
style_prefix "game_menu"
if main_menu:
if persistent.end:
add "images/ending.png"
else:
add gui.main_menu_background
else:
add gui.game_menu_background
Re: Main Menu image
I did this, but main menu picture didn't change after end of the game...Draziya wrote: ↑Sat Feb 24, 2018 7:44 pm I notice that you mentioned your game doesn't have multiple choices. This is what I did for a kinetic VN I did.
At the end of the game I added a persistent variable.Code: Select all
label end: "THE END" $ persistent.end = 1
I added an if statement with that persistent variable in the game_menu in screens.rpy.Code: Select all
screen game_menu(title, scroll=None, yinitial=0.0): style_prefix "game_menu" if main_menu: if persistent.end: add "images/ending.png" else: add gui.main_menu_background else: add gui.game_menu_background
of the people for the people
- Draziya
- Regular
- Posts: 70
- Joined: Sun Nov 26, 2017 8:50 am
- Completed: this was for you. [NaNoRenO 19], Acetylene [AceJam19], Ah!! My Roommate is a Succubus Hellbent on World [MonJam 18], I Don't Have A Clue [QRMJam 18], Cautionary Tale [NaNoRenO 18], OP Dodge Cross [GGJ 18], Acetone [AceJam 18]
- Projects: I'm a love interest in my childhood friend's reverse harem!!
- Organization: Watercress
- itch: Drazillion
- Contact:
Re: Main Menu image
My apologies! I was looking at the wrong part of my code. That's for the background of the game menu (which you still might want). The background for the main menu is the same but in the main_menu screen in screens.rpy
Code: Select all
screen main_menu():
## This ensures that any other menu screen is replaced.
tag menu
style_prefix "main_menu"
if persistent.end:
add "images/ending.png"
else:
add gui.main_menu_background
Re: Main Menu image
Its working, thank you!Draziya wrote: ↑Sun Feb 25, 2018 5:08 am My apologies! I was looking at the wrong part of my code. That's for the background of the game menu (which you still might want). The background for the main menu is the same but in the main_menu screen in screens.rpy
Code: Select all
screen main_menu(): ## This ensures that any other menu screen is replaced. tag menu style_prefix "main_menu" if persistent.end: add "images/ending.png" else: add gui.main_menu_background
of the people for the people
Who is online
Users browsing this forum: Google [Bot]