Animated 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
deltazechs
Newbie
Posts: 16
Joined: Thu Nov 16, 2006 2:10 pm
Contact:

Animated Main Menu

#1 Post by deltazechs »

I have a question about the main menu. I heard somewhere before that it's possible to have an animated background when the main menu is displayed (aka showing a simple list of images at decided intervals)

How do you do that? Thank you for any help provided.

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#2 Post by monele »

Mm... haven't tried but maybe this is it :

Code: Select all

init:
    $ animmenu = Animation("1.jpg", 2.0, "2.jpg", 2.0, "3.jpg", 2.0)
    
    $ style.mm_root.background = animmenu
If it's not mm_root, try gm_root. And of course, replace "*.jpg" by your pictures... and "2.0" by the time in seconds you want them to be displayed. The animation will loop.

deltazechs
Newbie
Posts: 16
Joined: Thu Nov 16, 2006 2:10 pm
Contact:

#3 Post by deltazechs »

thank you, i will give this a try then :D

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

#4 Post by DaFool »

Hmmm...my test mule has something like this:

Code: Select all

    $ titlefader = Animation("amano1.jpg", 4.00, "amano2.jpg", 4.00)
    $ style.mm_root.background = LiveComposite((800,600), (0, 120), titlefader, )
where amano1 and amano2 are 800x340, so they appear as if in widescreen.

Senpai88
Newbie
Posts: 8
Joined: Wed Feb 14, 2007 1:10 am
Location: The Dojo
Contact:

#5 Post by Senpai88 »

Say I wanted to have a still background and then have smaller images cycle on the left side of the screen, how would I do this? Could I just add "at left," or is it more complicated?
Image

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

#6 Post by DaFool »

Code: Select all

    $ wowanime = anim.Filmstrip(
             "romanclub.jpg",
             (400,600),
             (3,2),
             5, 6, True, ) 
    $ title = ui.text("Test Mule", size = 24, color = (160, 160, 160, 255))
    $ style.mm_root.background = LiveComposite((800, 600), (0, 0), wowanime, (444, 44), "bluehairvp3.jpg", (.55, .60), title, )
Image bluehairvp3 is 312x300, romanclub.jpg is 1200x1200, a single image that is used as a filmstrip since it is 2 rows tall and 3 columns wide

The filmstrip image is displayed on the left side of the screen, while the stationary image is on the right. They are all live-composited together, including the Title.

My Test Mule is currently set for other settings, so I haven't had a chance to reactivate this code, but it should work.

EDIT: my example uses the default black background. In your case I guess your BG will take the place of bluehairvp3 and will be positioned as full-size.

frumplstlskn
Regular
Posts: 51
Joined: Sun Feb 18, 2007 4:56 am
Location: Vancouver, Canada
Contact:

Re: Animated Main Menu

#7 Post by frumplstlskn »

deltazechs wrote:I have a question about the main menu. I heard somewhere before that it's possible to have an animated background when the main menu is displayed (aka showing a simple list of images at decided intervals)

How do you do that? Thank you for any help provided.
You can make a clip in windows movie maker. Just insert the pictures, decide the timings and save it in a video format compatible with Renpy. Then you can insert it into your code, set it to loop and hopefully have the effect you were going for (I can't give you any of the actual code because I haven't learnt much Renpy script yet ^^;).

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#8 Post by PyTom »

DaFool >>> For big stuff, it's better to use many images then one Filmstrip. IIRC, the filmstrip takes up twice as much memory as the small images.

frumplstlskn >>> I recommend against using a movie as the main menu background. While theoretically supported, in practice it doesn't work too well when there's something on top of the menu. (When a menu is full-window, then we use hardware acceleration, if possible.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot]