I tried to create the menu myself but ran into several problems. I’m using Ren’Py version 8.3.7. The screen code is partially adapted from this post:
Here is what I currently have in my press_to_start code:
Code: Select all
image black = "#000"
image white = "#ffffff"
image logo = "gui/logo/logo.png"
transform transform_logo:
on show:
alpha 0 xalign 0.5 yalign 0.5
linear 2.0 alpha 1
on hide:
linear 2.0 alpha 0
transform transform_white:
on show:
alpha 0
linear 2.0 alpha 1
on hide:
linear 2.0 alpha 0
transform fade_in:
alpha 0
linear 1.5 alpha 1
label splashscreen:
scene black
$ renpy.pause(1) # removed hard=True
show white at transform_white
$ renpy.pause(2) # removed hard=True
show logo at transform_logo
$ renpy.pause(6) # removed hard=True
hide logo
$ renpy.pause(2) # removed hard=True
hide white
$ renpy.pause(3) # removed hard=True
return
Code: Select all
image logo = "gui/logo/logo.png"
transform logo_fade:
alpha 0.0
linear 1.0 alpha 1.0
screen main_menu():
## This tag ensures that any other screen with the same tag will replace this one.
tag menu
add gui.main_menu_background
## This empty frame dims the main menu.
frame:
style "main_menu_frame"
## The 'use' operator includes another screen here. The actual menu content is on the navigation screen.
use navigation
if gui.show_name:
vbox:
style "main_menu_vbox"
add "logo" at logo_fade xpos 150 ypos -450 xanchor 0.5 yanchor 0.5 zoom 1.4
text "[config.name!t]":
style "main_menu_title"
text "[config.version]":
style "main_menu_version"
style main_menu_frame is empty
style main_menu_vbox is vbox
style main_menu_text is gui_text
style main_menu_title is main_menu_text
style main_menu_version is main_menu_text
style main_menu_frame:
xsize 420
yfill True
background "gui/overlay/main_menu.png"
style main_menu_vbox:
xalign 1.0
xoffset -30
xmaximum 1200
yalign 1.0
yoffset -30
style main_menu_text:
properties gui.text_properties("main_menu", accent=True)
style main_menu_title:
properties gui.text_properties("title")
style main_menu_version:
properties gui.text_properties("version")
-I want the main menu music (Moon-BGM.ogg) to start automatically after pressing the "press to start" button, and I want a small animation on the main_menu screen that gradually layers images to create a full artwork. This animation and music should play only once when the game starts. When the player enters save/load/settings or other menus, the music and animation should NOT repeat. The whole sequence should repeat only after the story ends or the player reaches the ending.
-The press_to_start screen remains visible on top of the main_menu, causing the music to restart on each click, which I don’t want. I want the press_to_start screen to disappear after clicking so the full main menu with animation and music can show without interfering.
What I want to solve:
-After pressing the screen on press_to_start, the main menu music should start automatically and the animation should play once.
-The press_to_start screen should hide after pressing so it doesn’t interfere with the main menu.
-Music should NOT restart on clicks or when going to other menus or loading saves.
-After the story ends or an ending is reached, the user should see the press_to_start screen with music and animation again.
-I want the player to be transferred to the main menu after pressing "start."
Here is an example of how I imagine the main screen: https://files.catbox.moe/4pn1k2.png
I tried different solutions, but they broke one after another, so I got really lost in coding. Please help me. If something is impossible, I can skip it, but I really want to implement the main screen like this because I really liked how some visual novels did it.
One of the things I tried:
In the gui folder, I have this line:
Code: Select all
define gui.main_menu_background = "gui/main_menu.png"
Code: Select all
image_background_menu:
contains:
"layers4.png"
pause 1.0
"layers3.png" with dissolve
pause 1.0
"layers1.png" with dissolve
pause 1.0
"layers.png" with dissolve
pause 1.0
repeat
Code: Select all
define gui.main_menu_background = "background_menu"
/ Sorry in advance if some words are mistranslated, I am using a translator. /