Making main menu images pop in

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
ProPinkist
Newbie
Posts: 2
Joined: Fri Aug 26, 2022 5:06 pm
Contact:

Making main menu images pop in

#1 Post by ProPinkist » Sun Aug 28, 2022 7:22 pm

How would I go about manipulating the individual assets of my main menu screen so that the character images and the title on it fade in, like in a lot of visual novels? I'm sorry, I know this is a really common question most likely, but I did a thorough search and could only really find situations that were more complex than what I'm looking for... I am a newbie to renpy though so ><

User avatar
laure44
Regular
Posts: 60
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: Making main menu images pop in

#2 Post by laure44 » Sun Aug 28, 2022 8:15 pm

Not sure if I got it right, do you want to make the elements fade in individually? If so, here's one way of doing it:

Code: Select all

transform mm_dissolve(p):
    alpha 0
    p # p seconds pass before appearing
    linear 1 alpha 1

screen main_menu():
    add "image" at mm_dissolve(1)
    textbutton "textbutton" at mm_dissolve(2)
    # and so on ...
You can also make the dissolve directly without creating the transform beforehand.

Code: Select all

screen main_menu():
    textbutton "textbutton":
        at transform:
            alpha 0.0
            pause 1
            linear 1 alpha 1

ProPinkist
Newbie
Posts: 2
Joined: Fri Aug 26, 2022 5:06 pm
Contact:

Re: Making main menu images pop in

#3 Post by ProPinkist » Sun Aug 28, 2022 9:23 pm

laure44 wrote:
Sun Aug 28, 2022 8:15 pm

Code: Select all

transform mm_dissolve(p):
    alpha 0
    p # p seconds pass before appearing
    linear 1 alpha 1

screen main_menu():
    add "image" at mm_dissolve(1)
    textbutton "textbutton" at mm_dissolve(2)
    # and so on ...
You can also make the dissolve directly without creating the transform beforehand.

Code: Select all

screen main_menu():
    textbutton "textbutton":
        at transform:
            alpha 0.0
            pause 1
            linear 1 alpha 1
Hmmm.... would each "image" label there be a different image file to put on top of the menu screen (in the gui folder I assume?)? How would it know where to correctly place them on the base/background image?

User avatar
laure44
Regular
Posts: 60
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: Making main menu images pop in

#4 Post by laure44 » Sun Aug 28, 2022 9:46 pm

ProPinkist wrote:
Sun Aug 28, 2022 9:23 pm
Hmmm.... would each "image" label there be a different image file to put on top of the menu screen (in the gui folder I assume?)? How would it know where to correctly place them on the base/background image?
It technically does not matter where are your images as long as you write the correct path. If your image path is "gui/main_menu/myimage.png", then you'll just have to write

Code: Select all

add "gui/main_menu/myimage.png"
or, if your image was already defined, you can write its name instead of the path.

Code: Select all

image myimage = "gui/main_menu/myimage.png"
screen main_menu():
    add "myimage"
As for when it comes to positionning, there are plenty of position style properties in the documentation that you can use.
https://www.renpy.org/doc/html/style_pr ... properties

Put those properties next to the add statement, like so

Code: Select all

add "myimage" xalign 0.5
Just remember that all elements placed in a screen are drawn from first to last, so the first image will be behind everything else.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot]