Particle Motion of Images on Main Menu [Not solved]

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
MoPark
Regular
Posts: 98
Joined: Sat Dec 31, 2011 7:05 pm
Projects: Kangaroo, Terminal Love
Location: DC
Contact:

Particle Motion of Images on Main Menu [Not solved]

#1 Post by MoPark » Sat Dec 31, 2011 7:31 pm

Hello!

I'm positive this has been asked before, and I did do a lot of searching throughout the forums to find the answer here, but to sadly no avail, so I made an account (or should I say activated an account, apparently I had already made one some time in the past). What I want to do is have some form of custom-defined path motion for a graphic on the title screen. I've found that a horizontal SnowBlossom with a count of 1 is very close to what I want, but I've decided that I'd want more manual control over it. So I took a look at Particles, as defined here, http://www.renpy.org/wiki/Particles, but I'm a bit confused on how to implement it.

My understanding is that I'd want to have something like this:
mm_root = Fixed( Image("static background graphic"), Particles(...) )
So my first question, is that what should be done for an implementation?

If so, my second question would be on the parameters that Particles accepts, and how to go about implementing it.

Sorry for asking such a silly question, and thank you for your help!
Last edited by MoPark on Mon Jan 02, 2012 4:02 am, edited 2 times in total.

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

Re: Particle Motion of Images on Main Menu

#2 Post by DaFool » Sun Jan 01, 2012 3:36 am

I just give main menu implementation of Adrift as example. Just reverse engineer the code for your own use.

Code: Select all

screen main_menu:
    tag menu
   
    window:
        background "mainmenubg" # contains the motion background
        foreground "mainoverlay" # contains the livecomposite of particle effects
        
      
    imagebutton:
        action Start()
        idle "start_idle"
        hover "start_hover"
        xanchor .5 yanchor 0.5
        xpos 125 ypos 50
    imagebutton:
        action ShowMenu("load")
        idle "load_idle"
        hover "load_hover"      
        xanchor .5 yanchor 0.5
        xpos 125 ypos 100
    imagebutton:
        action Jump("pregallery")
        idle "gall_idle"
        hover "gall_hover"         
        xanchor .5 yanchor 0.5
        xpos 125 ypos 150
    imagebutton:
        action ShowMenu("preferences")
        idle "prefs_idle"
        hover "prefs_hover"         
        xanchor .5 yanchor 0.5
        xpos 125 ypos 200           
    imagebutton:
        action Help()
        idle "help_idle"
        hover "help_hover"      
        xanchor .5 yanchor 0.5
        xpos 125 ypos 250
    imagebutton:
        action Quit(confirm=False)
        idle "quit_idle"
        hover "quit_hover"         
        xanchor .5 yanchor 0.5
        xpos 125 ypos 300            
Here's the particle effect (bubbles rising from bottom. I think you just flip some of these values to + or - depending on your application.

Code: Select all

    image bubbling = SnowBlossom("gui/singlebubble_small.png", count=7, border=50, xspeed=(20, 50), yspeed=-100, start=3, horizontal=False)
Here I decided merely bubbles aren't enough. I wanted the title to seem to be drifting as well. So the best way to combine movement is LiveComposite

Code: Select all

    image transoverlay = LiveComposite(
        (1100, 644), 
        (300, 480), "titlewave",
        (0, 0), "bubbling",
    )
Still not being crazy enough, we even wanted the main menu bg itself to move, so we defined a transform for it

Code: Select all

    transform reversewaveside:
        linear 2.2 xalign 0.0 yalign 0.68
        linear 2.2 xalign 0.0 yalign 0.32       
        repeat         
    image mainoverlay = At("transoverlay", reversewaveside)
Then you see in the main_menu screen everything put together in background and foreground

User avatar
MoPark
Regular
Posts: 98
Joined: Sat Dec 31, 2011 7:05 pm
Projects: Kangaroo, Terminal Love
Location: DC
Contact:

Re: Particle Motion of Images on Main Menu

#3 Post by MoPark » Mon Jan 02, 2012 3:38 am

Beautiful! I'm gonna play with variables around to make it close to what I'd like, but that is truly beautiful. Thanks so much man, I owe ya one!

Post Reply

Who is online

Users browsing this forum: No registered users