How do I add my animated falling hearts to my main menu?

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
ArudanisMe
Newbie
Posts: 6
Joined: Fri Sep 14, 2018 12:28 am
Completed: mibak
Projects: FAN VISUAL NOVEL: Codename: Kids Next Door: Operation: SWEET ACCENTS
Organization: ArudanisMe
IRC Nick: ArudanisMe
Tumblr: mibak
Deviantart: ArudanisMe
Github: mibak
Soundcloud: ArudanisMe
itch: renpytom
Location: GB
Contact:

How do I add my animated falling hearts to my main menu?

#1 Post by ArudanisMe »

Hey guys. So im stuck on something. For the ATL, I wanna know how do I add animated falling hearts to my main menu background as an animation? I know you cannot use gifs more like moving pictures with pngs instead? I just need to know where to add/and type a code for it since I got all the image sequences made for it. Using jedit by the way.

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
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-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: How do I add my animated falling hearts to my main menu?

#2 Post by Per K Grok »

ArudanisMe wrote: Fri Sep 14, 2018 12:31 am Hey guys. So im stuck on something. For the ATL, I wanna know how do I add animated falling hearts to my main menu background as an animation? I know you cannot use gifs more like moving pictures with pngs instead? I just need to know where to add/and type a code for it since I got all the image sequences made for it. Using jedit by the way.
in script.rpy before "label start:"

Code: Select all

image anim_harts:
    "hart1.png"
    0.2              # pause in seconds
    "hart2.png"
    0.2
    "hart3.png"
    0.2
    repeat      #repeat the animation
in screens.rpy under "screen main_menu():" and after "add gui.main_menu_background"

Code: Select all

add "anim_harts"
or you could place it under "screen navigation():" under "if main_menu:"

An alternative could be to make a video, define that as an image and add that the same way in screens.rpy

User avatar
ArudanisMe
Newbie
Posts: 6
Joined: Fri Sep 14, 2018 12:28 am
Completed: mibak
Projects: FAN VISUAL NOVEL: Codename: Kids Next Door: Operation: SWEET ACCENTS
Organization: ArudanisMe
IRC Nick: ArudanisMe
Tumblr: mibak
Deviantart: ArudanisMe
Github: mibak
Soundcloud: ArudanisMe
itch: renpytom
Location: GB
Contact:

Re: How do I add my animated falling hearts to my main menu?

#3 Post by ArudanisMe »

Got it to work! ...but now my game menu background turned into the main menu background instead. There a way to get my game menu BG back?

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: How do I add my animated falling hearts to my main menu?

#4 Post by Donmai »

ArudanisMe wrote: Fri Sep 14, 2018 2:15 am Got it to work! ...but now my game menu background turned into the main menu background instead. There a way to get my game menu BG back?
Looks like it's only one of the New GUI's tricks which let me confused for some time too. Run your game, access the game menu by pressing Esc or using the quick menu, and see if your game menu background appears then. I hated it, but that's how it's supposed to work now. There must be a way of changing this behavior by messing with the scripts. Looks like the oddity is here:

Code: Select all

screen game_menu(title, scroll=None, yinitial=0.0):

    style_prefix "game_menu"

    if main_menu:
        add gui.main_menu_background #if you just left the main menu, keep the same background (as I understood it).
    else:
        add gui.game_menu_background # if coming from any other screen, show the game menu background.
I'm not in love with the new GUI.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: No registered users