Page 1 of 1

animation in main menu

Posted: Mon May 05, 2008 10:18 am
by Poldy
Hello!

Is it possible to have an animation as the main menu background? - My VN is set in winter and the whole main-menu screen is kind of crappy without falling snow... :(

Currently is set the background with

Code: Select all

mm_root = "title-screen.png"
in options.rpy. mm_root onyl accepts image names, is there a way to use a displayable instead as the mm-background?

Thanks for your help!

Re: animation in main menu

Posted: Mon May 05, 2008 11:20 am
by luminarious
Erm, I had the exact same problem.. :P

If it's too complex to use animation, can at least the particle system somehow be used on the menu screen?

Re: animation in main menu

Posted: Mon May 05, 2008 11:42 am
by PyTom
mm_root should accept animations. Have you tried something like mm_root=Animation(...)? That _should_ work. If I wanted to use a particle system, I'd do something like:

mm_root=Fixed(
Particle(...),
Image(...))

Re: animation in main menu

Posted: Mon May 05, 2008 12:00 pm
by luminarious
I'm sorry, I think I'm being a bit dense right now, but if that's the syntax, how can I use at the same time a background picture and SnowBlossom?

Re: animation in main menu

Posted: Mon May 05, 2008 12:20 pm
by Jake
luminarious wrote:I'm sorry, I think I'm being a bit dense right now, but if that's the syntax, how can I use at the same time a background picture and SnowBlossom?
The 'Fixed' class which PyTom mentions is a layout class which will contain other displayables, so that when the Fixed is drawn it will draw first one of its parameters, then the other one:

http://renpy.org/wiki/Fixed

Although by the look of the docs there, he got the parameters the wrong way around. ;-)

Re: animation in main menu

Posted: Mon May 05, 2008 12:23 pm
by luminarious
Thank you, got it now! :D

Re: animation in main menu

Posted: Mon May 05, 2008 12:30 pm
by Poldy
Thanks a lot! I was mislead by the comment in the template's option.rpy:

Code: Select all

        ## The background of the main menu. This can be a color
        ## beginning with '#', or an image filename. The latter
        ## should take up the full height and width of the screen.
which should be changed in that any(?) displayable is accepted. - Anyway thanks again, that saved my day :)

Re: animation in main menu

Posted: Mon May 26, 2008 9:02 pm
by zephiel
eh? im lost, im trying to use a gif.... do gif work?

cause i get this error

Code: Select all

While executing init code:
 - script at line 10 of C:\Documents and Settings\haseeb1\Desktop\R渭dem'i\renpy-6.6.2-full\renpy-6.6.2\roxdemi/game/options.rpy
 - python at line 77 of C:\Documents and Settings\haseeb1\Desktop\R渭dem'i\renpy-6.6.2-full\renpy-6.6.2\roxdemi/game/options.rpy.

Re: animation in main menu

Posted: Tue May 27, 2008 4:49 am
by EvilDragon
I think that gifs don't work with renpy.

Re: animation in main menu

Posted: Tue May 27, 2008 10:32 am
by Jake
GIFs don't work as animations in Ren'Py; you need to define your own with the Animation displayable.

And as it goes, the 'error' you posted isn't helpful in the least, Zephiel. All you've given us is the first couple of lines of the stack trace - that is, it's telling us where in your script the error occurred. But since we don't have your script, and we don't know what the error actually was (it's in the same traceback.txt file, further down) we can't really help you just based on that, we have to guess what you're doing wrong. It might be totally unrelated to GIFs for all we know.

When you have a problem, you really need to post the entire traceback.txt file, and it really helps if you post the lines from your script which are causing the error as well. The traceback tells you which line numbers are responsible.

Re: animation in main menu

Posted: Wed May 28, 2008 11:43 pm
by zephiel
oh, sorry. will gif ever be usable? or wat format is usable?

im trying to ad animation to my main menu.

i apreciate the help

Re: animation in main menu

Posted: Thu May 29, 2008 3:07 am
by EvilDragon
I think (I don't know actually) that renpy doesn't support APNGs (animated PNGs), so this way you're stuck with defining the animation on a per-frame filmstrip basis (which is complicated for longer animations, see http://www.renpy.org/wiki/renpy/doc/ref ... .Filmstrip).

It may be a better idea to record your animation as an MPEG-1 video (and keep it as small as possible) and then embed it in a displayable that will show it on the main menu.

Re: animation in main menu

Posted: Thu May 29, 2008 7:51 am
by Jake
zephiel wrote:oh, sorry. will gif ever be usable?
I'm pretty sure PyTom's said he has no plans to implement it.
zephiel wrote: or wat format is usable?
The one I mentioned in my last post, for one - save out your frames individually and assemble them into an Animation displayable. It's really not difficult if you follow the example in the manual.

Compiling your animation into an MPEG1 video will probably be more trouble than it's worth for a short animation, and assembling an Animation displayable frame by frame is probably more trouble than it's worth for a long animation.

IIRC also that when Ren'Py plays MPEG1 videos it hands the audio mixer off to the movie-playing code wholesale, so you can't play any other sounds while your animation is going on.