Main Menu Help!

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
User avatar
Akutasan
Newbie
Posts: 7
Joined: Thu Mar 07, 2019 9:25 am
Location: Your motherboard
Contact:

Main Menu Help!

#1 Post by Akutasan » Thu Mar 07, 2019 5:46 pm

Hello.
I wanted to have a Logo appear in the main menu before the game starts.
I'm a beginner and don't know how to do...
This is what I've got but I don't even know what I'm writing and Google isn't really helping..

Code: Select all

   image main_menu:
        "gui/logo/Example.png"
[...]

show main_menu:
    add "main_menu"
    xpos=0.25
    ypos=0.25
    
label start:
And if someone could tell me, what

Code: Select all

add "main_menu"
means, it'd be really greatful :D
(Sorry for my bad english...)
Akutasan

User avatar
isobellesophia
Miko-Class Veteran
Posts: 787
Joined: Mon Jan 07, 2019 2:55 am
Projects: Maddox and Friends 2020 aka (AI Teacher), Friendly Universities 2020-2021 (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: .......
Location: Philippines, Mindanao
Contact:

Re: Main Menu Help!

#2 Post by isobellesophia » Fri Mar 08, 2019 7:26 am

A splashscreen would be useful.

viewtopic.php?t=46121
I am a friendly user, please respect and have a good day..

Be safe for the pandemic everyone, god bless.


Working on a talking simulation game for everyone, except children.

Maddox Everyday Talk!
Is my very very main project, not contain 13 below.

Main project here viewtopic.php?f=43&t=56564
Image

User avatar
Per K Grok
Miko-Class Veteran
Posts: 628
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1
Projects: Defenders of Adacan Part 2
Deviantart: pekj
itch: per-k-grok
Location: Sverige
Contact:

Re: Main Menu Help!

#3 Post by Per K Grok » Fri Mar 08, 2019 1:16 pm

Akutasan wrote:
Thu Mar 07, 2019 5:46 pm
Hello.
I wanted to have a Logo appear in the main menu before the game starts.
I'm a beginner and don't know how to do...
This is what I've got but I don't even know what I'm writing and Google isn't really helping..

Code: Select all

   image main_menu:
        "gui/logo/Example.png"
[...]

show main_menu:
    add "main_menu"
    xpos=0.25
    ypos=0.25
    
label start:
And if someone could tell me, what

Code: Select all

add "main_menu"
means, it'd be really greatful :D
(Sorry for my bad english...)
Try this

Code: Select all

add "gui/logo/Example.png" xpos 200 ypos 200
Put in screens.rpy under "screen main_menu():".

xpos and ypos is the position in pixels counted from the screens top left image to the top left corner of the image.
You can not have fractions of a pixel, so xpos = 0.25 makes no sense.
Image Visual Story Telling, DeviantArt Group for animations, comics, games and illustrations https://www.deviantart.com/acgi

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: Main Menu Help!

#4 Post by mitoky » Fri Mar 08, 2019 1:44 pm

Hello!
You would need a splashscreen for this. I did a tutorial on this before, so i am copy pasting the template here for you (each step is explained, feel free to ask if you have questions!)

Code: Select all

#####################################################################################
## Transforms 
#####################################################################################

#Transformation for Logo    
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

#Transformation for background
transform transform_white:
    on show:
        alpha 0 
        linear 2.0 alpha 1
    on hide:
        linear 2.0 alpha 0

#####################################################################################
## Images
#####################################################################################

#Your Logo
image logo = "gui/logo/Example.png"
#A Black BG
image black = "#000000"
#A White BG
image white = "#ffffff"    

#####################################################################################
## Splashscreen
#####################################################################################

label splashscreen:
    scene black #We start with a black scene
    $ renpy.pause(1, hard=True) #Pauses the black screen for a second. This command pauses renpy, hence makes it unable to click
    
    show white at transform_white #next we swho our white screen with our made transformation
    $ renpy.pause(2, hard=True) #For this its important to know the transformation time. Since the transformation is "happening" at the same time, the pause needs to be at least as long as the transformation. Otherwise it gets cut off.
    
    show logo at transform_logo #Next, we are showing our logo with our logo transformation.
    $ renpy.pause(6, hard=True) #Our logo takes 2 second to appear, however, we want it to stay on the screen for a while, hence we are using 6 instead of 2 seconds, so it stays for 4 seconds.
    
    hide logo #Next we are hiding our logo
    $ renpy.pause(2, hard=True) #Since the transformation is 2 seconds long, the pause here is 2 seconds long.
    
    hide white #Next we are hiding our background.
    $ renpy.pause(3, hard=True) # Our hiding transformation for the white bg takes 2 seconds, but since we want the screen to stay black for a second, like at the beginning, we use 3 instead.
    
    return

Post Reply

Who is online

Users browsing this forum: komehara, Nero, Xasrai