Adding Effects to the Opening Menu (+Other Questions)

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Message
Author
dr-black-jack
Newbie
Posts: 12
Joined: Fri Dec 05, 2008 6:52 am
Contact:

Adding Effects to the Opening Menu (+Other Questions)

#1 Post by dr-black-jack »

I've taken a look at the renpy demo and really liked the cherry blossom snow fall effect that was included. Though I am able to successfully apply the effect in game, I was just wondering whether or not it were at all psosible to apply the effect so that it also appears on the main menu.

The second main question I would like to ask is if it were at all possible to add moving .gif images to a scene in game rather than static images alone?

And for my final question, I was wondering whether or not there was some cod eto change the in game side menu in such a way that it could 'slide' out of the corner of the screen when the mouse cursor ran over it. Changing the opening menus, load menus and options menus was really quite helpful in the forums, however I have never seen any instructions in the cook book on how to change the in game menus away from the default but would definately love to learn any ways I could.

Sorry in advance if any of these are 'noobish' at all in any way and thanks very much to anyone wou could help!

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

Re: Adding Effects to the Opening Menu (+Other Questions)

#2 Post by monele »

For animation, you will want to turn your animations into multiple pictures (one per frame of animation) and then use "Animation" :

http://renpy.org/wiki/Animation

Animated GIFs themselves are not supported in Ren'Py.

dr-black-jack
Newbie
Posts: 12
Joined: Fri Dec 05, 2008 6:52 am
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#3 Post by dr-black-jack »

Ah so that's how it works! That certainly does clear a lot of things up XD

But if that is the case, would it be at all possible to insert that sort of animation for something simple (two or maybe three frames) to be used in the opening menu screen?

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#4 Post by JQuartz »

dr-black-jack wrote:I was just wondering whether or not it were at all psosible to apply the effect so that it also appears on the main menu.
Just add

Code: Select all

init:
    image snowblossom = SnowBlossom(anim.Filmstrip("sakura.png", (20, 20), (2, 1), .15), fast=True)
and in the label main_menu add

Code: Select all

    show snowblossom
An example is...:

Code: Select all

label main_menu:
    $ ui.add(renpy.Keymap(toggle_fullscreen = renpy.toggle_fullscreen))
    $ ui.frame(xpos=560, ypos=420)
    $ ui.vbox()
    $ ui.button(clicked=ui.jumpsoutofcontext('start'), background='#003c78',hover_background='#0050a0',xminimum=170,yminimum=10)
    $ ui.text('Start Game',hover_color='#c8ffff',color='#c8ffff',size=22,font='DejaVuSans.ttf')
    $ ui.button(clicked=_intra_jumps('load_screen', 'main_game_transition'), background='#003c78', hover_background='#0050a0', xpos=0, ypos=0,xminimum=170,yminimum=10)
    $ ui.text('Continue',hover_color='#c8ffff',color='#c8ffff',size=22,font='DejaVuSans.ttf')
    $ ui.button( clicked=_intra_jumps('preferences_screen','main_game_transition'), background='#003c78', hover_background='#0050a0', xpos=0, ypos=0,xminimum=170,yminimum=10)
    $ ui.text('Preferences',hover_color='#c8ffff',color='#c8ffff',size=22,font='DejaVuSans.ttf')
    $ ui.button( clicked=ui.jumps('_quit'), background='#003c78', hover_background='#0050a0', xpos=0, ypos=0,xminimum=170,yminimum=10)
    $ ui.text('Quit',hover_color='#c8ffff',color='#c8ffff',size=22,font='DejaVuSans.ttf')
    $ ui.close()
    show snowblossom 
    $ ui.interact(suppress_overlay=True, suppress_underlay=True, mouse='mainmenu')

init:
    image snowblossom = SnowBlossom(anim.Filmstrip("sakura.png", (20, 20), (2, 1), .15), fast=True)
The main menu (minus the show snowblossom) is generated by main menu generator http://lemmasoft.renai.us/forums/viewto ... f=8&t=2944.
dr-black-jack wrote:however I have never seen any instructions in the cook book on how to change the in game menus away from the default but would definately love to learn any ways I could.
Use main menu generator(http://lemmasoft.renai.us/forums/viewto ... f=8&t=2944) or layout http://www.renpy.org/wiki/renpy/doc/reference/Layouts
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

dr-black-jack
Newbie
Posts: 12
Joined: Fri Dec 05, 2008 6:52 am
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#5 Post by dr-black-jack »

Ah, thank you very much!

So it is possible to add the blossom effect after all XD I tried inserting your code example into my existing code which uses the layout.imagemap_main_menu style of menu layout, however, all I seem to have gotten was a black screen with the blossoms, my existing music, and your menu layout style. Is there any way at al that I can still retain my menu using the imagemap style main menu layout since just adding 'show snowblossom' by itself to a new label causes an error. (i'm still trying to learn the syntax of this thing lol)

Also, thanks very much for showing me the random main menu generator, that is quite an interesting little tool you've developed. However, what I was looking for was a way to move or re-arrange the in game menu buttons themselves.

I thought about trying ot follow the pattern of the other image layout menus and write something like

Code: Select all

init -2 python:
    layout.imagemap_button_menu("mainmenu.jpg", "mainmenu2.jpg", [
        (63, 557, 224 ,602, "Start Game"),
        (63, 602, 224, 639, "Load Game"),
        (63, 639, 224, 677, "Preferences"),
        (63,677,224,719, "Quit"),
        ])
however that attempt sort of failed ^^;

What exactly am I doing wrong?

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#6 Post by JQuartz »

dr-black-jack wrote:Is there any way at al that I can still retain my menu using the imagemap style main menu layout
I don't think so but I could be sure since layout doesn't seem to work on my computer(it just ends up crashing or setting up unclickable buttons)
dr-black-jack wrote:Also, thanks very much for showing me the random main menu generator, that is quite an interesting little tool you've developed. However, what I was looking for was a way to move or re-arrange the in game menu buttons themselves.
The main menu generator can reposition the buttons. Click on Extra Stuff, Toggle Box, click Return, click Start Button, then click Reposition. Click on the other buttons and reposition them as well.
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

User avatar
chensterrain
Veteran
Posts: 225
Joined: Sun Oct 26, 2008 2:01 am
Completed: Lucky Rabbit Reflex!, Dusk ~A Moonlight Romance~
Projects: Edge of Elsewhere
Organization: Super63
Tumblr: supersixthree
Deviantart: chensterrain
Location: London, UK
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#7 Post by chensterrain »

There is a way of displaying a snowblossom animation along with an imagemap main menu, actually, though you might have to change your imagemap a little? The code I have is this:

Code: Select all

        mm_root=Fixed(
        Image("BG-title.png"),
        SnowBlossom("snow2.png", count=10, xspeed=(10, 30), yspeed=(50, 70), start=7)),
Where BG-title is the main menu background image without any buttons or anything. I guess 'fixed' allows you to slap all these properties together? Iunno. :lol: I then made my imagemaps so that they were transparent apart from the 'start game' etc text:

Code: Select all

    layout.imagemap_main_menu("IM-titlenormal.png", "IM-titlehover.png", [
        (40, 554, 158, 593, "Start Game"),
        (240, 554, 345, 593, "Load Game"),
        (434, 554, 578, 593, "Preferences"),
        (667, 554, 763, 593, "Quit"),
        ])
I'm not sure if that's what you were looking for, but hope it helps...! :)

dr-black-jack
Newbie
Posts: 12
Joined: Fri Dec 05, 2008 6:52 am
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#8 Post by dr-black-jack »

JQuartz wrote:The main menu generator can reposition the buttons. Click on Extra Stuff, Toggle Box, click Return, click Start Button, then click Reposition. Click on the other buttons and reposition them as well.
Ah I get you. I did click the extra stuff to toggle the box and that did allow me to reposition the opening screen elements with great ease, however that only allows me to reposition the mainmenu buttons rather than the buttons that appear on the bottom right hand corner when the actual game is started itself. Is it at all possible to reposition those buttons, as well as the buttons in the prefernces, load/save screen, yes/no screen menus in a simlar way?

Oh and thanks for the tips with the snow blossom effect, I managed to get it going, though I had to ensure tha tmy background was a plain, single color, with the rest of the detail moved to a seperate file that becomes the foreground layer.

dr-black-jack
Newbie
Posts: 12
Joined: Fri Dec 05, 2008 6:52 am
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#9 Post by dr-black-jack »

chensterrain wrote:There is a way of displaying a snowblossom animation along with an imagemap main menu, actually, though you might have to change your imagemap a little? The code I have is this:

Code: Select all

        mm_root=Fixed(
        Image("BG-title.png"),
        SnowBlossom("snow2.png", count=10, xspeed=(10, 30), yspeed=(50, 70), start=7)),
Where BG-title is the main menu background image without any buttons or anything. I guess 'fixed' allows you to slap all these properties together? Iunno. :lol: I then made my imagemaps so that they were transparent apart from the 'start game' etc text:

Code: Select all

    layout.imagemap_main_menu("IM-titlenormal.png", "IM-titlehover.png", [
        (40, 554, 158, 593, "Start Game"),
        (240, 554, 345, 593, "Load Game"),
        (434, 554, 578, 593, "Preferences"),
        (667, 554, 763, 593, "Quit"),
        ])
I'm not sure if that's what you were looking for, but hope it helps...! :)
Well now, that was actually prety easy XD And I do get what you meant by the imagemap's thing since I had to pretty much do the same thing as well to allow the blossom effect to be visible. Thanks for the assistance!

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#10 Post by JQuartz »

dr-black-jack wrote:however that only allows me to reposition the mainmenu buttons rather than the buttons that appear on the bottom right hand corner when the actual game is started itself.
Oh, you wanted to reposition game menu buttons. I thought you wanted to reposition main menu buttons. It's a main menu generator so it can't reposition game menu buttons. You'll have to use layouts for that.
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

dr-black-jack
Newbie
Posts: 12
Joined: Fri Dec 05, 2008 6:52 am
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#11 Post by dr-black-jack »

JQuartz wrote:
dr-black-jack wrote:however that only allows me to reposition the mainmenu buttons rather than the buttons that appear on the bottom right hand corner when the actual game is started itself.
Oh, you wanted to reposition game menu buttons. I thought you wanted to reposition main menu buttons. It's a main menu generator so it can't reposition game menu buttons. You'll have to use layouts for that.
Thanks for all your help anyway. Your program was a real lifesaver

I was however, a little curious as to why the CG gallery I imported as an 'extra button' did not want to function in the game utilizing the menu generated through your program. It allows me to access the CG gallery at first as per the renpy cookbook instructions (assigning the extra button to the 'gallery' label as per the renpy default) however when I press the 'return' button to return to the title page, the program crashes for no apparent reason when I try to press any other buttons

I'm not sure exactly what line of code is doing this but I was wondering if you or anyone out there could please help me out

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#12 Post by JQuartz »

dr-black-jack wrote:the program crashes for no apparent reason when I try to press any other buttons
If it crashes then traceback or error.txt should have been created. Could you post it? Also, what version of Renpy are you using and what version of main menu generator are you using ?(The main menu generator version should be seen in the filename)
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

dr-black-jack
Newbie
Posts: 12
Joined: Fri Dec 05, 2008 6:52 am
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#13 Post by dr-black-jack »

JQuartz wrote:
dr-black-jack wrote:the program crashes for no apparent reason when I try to press any other buttons
If it crashes then traceback or error.txt should have been created. Could you post it? Also, what version of Renpy are you using and what version of main menu generator are you using ?(The main menu generator version should be seen in the filename)

Code: Select all

I'm sorry, but an exception occured while executing your Ren'Py
script.

JumpOutException: start

While running game code:
 - script at line 17 of C:\Desktop\New Folder\renpy-6.8.1\VN game/game/mainmenu.rpy
 - python at line 17 of C:\Desktop\New Folder\renpy-6.8.1\VN game/game/mainmenu.rpy.

-- Full Traceback ------------------------------------------------------------

  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\bootstrap.py", line 247, in bootstrap
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\main.py", line 309, in main
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\main.py", line 92, in run
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\execution.py", line 199, in run
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\ast.py", line 554, in execute
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\python.py", line 880, in py_exec_bytecode
  File "C:\Desktop\New Folder\renpy-6.8.1\VN game/game/mainmenu.rpy", line 17, in <module>
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\ui.py", line 58, in interact
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\display\core.py", line 1327, in interact
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\display\core.py", line 1798, in interact_core
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\display\layout.py", line 583, in event
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\display\transition.py", line 58, in event
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\display\layout.py", line 583, in event
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\display\layout.py", line 583, in event
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\display\behavior.py", line 407, in event
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\curry.py", line 38, in __call__
  File "C:\Desktop\New Folder\renpy-6.8.1\renpy\ui.py", line 406, in _jumpsoutofcontext
JumpOutException: start

While running game code:

Ren'Py Version: Ren'Py 6.8.1a
my line 17 is this

Code: Select all

    $ ui.interact(suppress_overlay=True, suppress_underlay=True, mouse='mainmenu')
This was what appeared after I accessed the gallery from the main menu and then clicked the 'return' button to return to the main menu. This happens no matter what button I press afterwards (including the exit button)

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#14 Post by JQuartz »

Sorry for the slow reply. I went to sleep just now.

Are you using this cookbook code?http://www.renpy.org/wiki/renpy/doc/coo ... CG_Gallery
I just can't seem to reproduce the crash. At first I thought it was a problem with the coding of the gallery button by main menu generator. But then it wasn't. Then I thought it was the return button problem but it wasn't either. So either you're using a outdated main menu generator (the version I tested this on was ver 1.7. You can see the version on the top of JQuartz_Editor.rpy. ) or you're using an outdated version of gallery or you edited mainmenu.rpy yourself. Since I'm not familiar with the CG gallery I can only offer methods that might help for the 1st and 3rd possibilities.

If it's possibility 1 (outdated version of main menu generator):
-Download ver 1.7 herehttp://lemmasoft.renai.us/forums/viewto ... f=8&t=2944
-Delete the old version (both JQuartz_Editor.rpy and rpyc)
-Move the new version into the project folder
-Transfer mainmenu.rpy and rpyc out from the folder.
-Run the game.
-Load the main menu you saved. (You did save, right?)
-Generate the file again.
-Close and start the game again.

If it's possibility 3 (you edited the mainmenu.rpy yourself):
-Check this particular button if anything in this button is different than yours. (Only those that are available. If it's not available then don't need to care)

Code: Select all

    $ ui.button(clicked=ui.jumpsoutofcontext('gallery'), )
    $ ui.text('CG Gallery')
This code should be in mainmenu.rpy line should be on line 11 to 12. If it's not there, then it's probably lower.

If you really did edit the mainmenu.rpy yourself and the above method doesn't help, you'll need to post your mainmenu.rpy here so I can help you.

And if the problem is the main menu generator you're using is outdated but you can't seem to load the safe file (Saves made in the earlier versions (lower than 1.5) is not compatible with the newer versions) then just post the mainmenu.rpy. I'll fix it for you. It's my fault for not making the save files compatible.
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

dr-black-jack
Newbie
Posts: 12
Joined: Fri Dec 05, 2008 6:52 am
Contact:

Re: Adding Effects to the Opening Menu (+Other Questions)

#15 Post by dr-black-jack »

Well, I checked through the file and found the following

The version of the menu generator i'm using is 1.6
The produced main menu file appears as follows

Code: Select all

label main_menu:
    $ ui.add(renpy.Keymap(toggle_fullscreen = renpy.toggle_fullscreen))
    $ ui.window(style='mm_root', background='#0043')
    $ ui.image('Chapter 14A/mainmenu.png', xpos=0, ypos=0)
    $ ui.button(clicked=ui.jumpsoutofcontext('start'), background='#0000',hover_background='#0000',xpos=128,ypos=245,xminimum=170,yminimum=10,hover_sound='None', activate_sound='None ' )
    $ ui.text('Start',hover_color='#000',color='#ffff',size=43,font='Fonts/times.ttf')
    $ ui.button(clicked=_intra_jumps('load_screen', 'main_game_transition'), background='#0000',hover_background='#0000',xpos=91,ypos=297,xminimum=170,yminimum=10,hover_sound='None', activate_sound='None ')
    $ ui.text('Continue',hover_color='#000',color='#ffff',size=43,font='Fonts/times.ttf')
    $ ui.button(clicked=_intra_jumps('preferences_screen', 'main_game_transition'), background='#0000',hover_background='#0000',xpos=102,ypos=348,xminimum=170,yminimum=10,hover_sound='None', activate_sound='None ')
    $ ui.text('Options',hover_color='#000',color='#ffff',size=43,font='Fonts/times.ttf')
    $ ui.button(clicked=ui.jumpsoutofcontext('gallery'), background='#0000',hover_background='#0000',xpos=104,ypos=399,xminimum=190,yminimum=10,hover_sound='None', activate_sound='None ')
    $ ui.text('Gallery',hover_color='#000',color='#ffff',size=43,font='Fonts/times.ttf')
    $ ui.button(clicked=ui.jumps('_quit'), background='#0000',hover_background='#0000',xpos=133,ypos=450,xminimum=170,yminimum=10,hover_sound='None', activate_sound='None ')
    $ ui.text('Exit',hover_color='#000',color='#ffff',size=43,font='Fonts/times.ttf')
    $ renpy.music.play('Music/titlealternate.ogg', fadein=2)
    show snowblossom
    $ ui.interact(suppress_overlay=True, suppress_underlay=True, mouse='mainmenu')
    
init:
    image snowblossom = SnowBlossom(anim.Filmstrip("sakura.png", (20, 20), (2, 1), .15), fast=True)   
I was actually using the old code for gallery access found here http://www.renpy.org/wiki/renpy/doc/cookbook/CG_Gallery however, when i did try to impliment the new CG gallery code, it kept comming up with the error

Code: Select all

Exception: The style gallery_nav_frame does not exist.

While executing init code:
 - script at line 3 of C:\Users\Desktop\New Folder\renpy-6.8.1\VN Game/game/cggallery.rpy
 - python at line 3 of C:\Users\\Desktop\New Folder\renpy-6.8.1\VN Game/game/cggallery.rpy.

-- Full Traceback ------------------------------------------------------------

  File "C:\Users\Desktop\New Folder\renpy-6.8.1\renpy\bootstrap.py", line 247, in bootstrap
  File "C:\Users\Desktop\New Folder\renpy-6.8.1\renpy\main.py", line 253, in main
  File "C:\Users\Desktop\New Folder\renpy-6.8.1\renpy\execution.py", line 199, in run
  File "C:\Users\Desktop\New Folder\renpy-6.8.1\renpy\ast.py", line 554, in execute
  File "C:\Users\Desktop\New Folder\renpy-6.8.1\renpy\python.py", line 880, in py_exec_bytecode
  File "C:\Users\Desktop\New Folder\renpy-6.8.1\VN Game/game/cggallery.rpy", line 3, in <module>
  File "C:\Users\Desktop\New Folder\renpy-6.8.1\renpy\style.py", line 279, in __getattr__
Exception: The style gallery_nav_frame does not exist.

While executing init code:

Ren'Py Version: Ren'Py 6.8.1a
I have absolutely no idea how the new CG gallery functions unfortunately, so your guess is as good as mine ^^;

Post Reply

Who is online

Users browsing this forum: No registered users