Help with Animated Menus?

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
madocallie
Regular
Posts: 44
Joined: Tue May 14, 2013 1:57 am
Completed: Bad Faith (DEMO), When We First Met, Party Favors
Projects: Bad Faith (Full Release)
itch: madocallie
Location: UK
Discord: madocallie#2937
Contact:

Help with Animated Menus?

#1 Post by madocallie » Wed Jul 10, 2013 9:16 pm

So, basically, I've been trying to code a menu which is animated, by having each "layer" of the menu appear one by one, forming the complete menu.

Unfortunately Ren'py's been complaining about it, so could I have some help? ono

The Code:

Code: Select all

# Main Menu 
#
# Screen that's used to display the main menu, when Ren'Py first starts
# http://www.renpy.org/doc/html/screen_special.html#main-menu

screen main_menu:
    
 transform mainmenu1: 
        alpha 0.1
        linear 1.0 alpha 1.0

 transform mainmenu2: 
        alpha 0.1
        1.0
        linear 1.0 alpha 1.0

 transform mainmenu3: 
        alpha 0.1
        2.0
        linear 1.0 alpha 1.0
        
 transform mainmenu4: 
        alpha 0.1
        2.0
        linear 1.0 alpha 1.0

 screen main_menu:
    add "into1.png" at mainmenu1
    add "into2.png" at mainmenu2
    add "into4.png" at mainmenu3
    imagemap at mainmenu4:
    
        ground "imagemenuhit.png"
        hover "imagemenuhover.png"
        idle "imagemenuidle.png"
        selected_idle "imagemenuhit.png"
        selected_hover "imagemenuhit.png"
        
        hotspot (0,98,284,70) action Start()
        hotspot (0,182,312,65) action ShowMenu("load")
        hotspot (0,263,339,68) action ShowMenu("preferences")
        hotspot (0,344,366,66) action Start()
        hotspot (607,460,192,50) action Help()
        hotspot (578,524,221,51) action Quit(confirm=True)


init -2 python:

    # Make all the main menu buttons be the same size.
    style.mm_button.size_group = "mm"
The complaint:

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/screens.rpy", line 173: u'mainmenu1' is not a keyword argument or valid child for the transform statement.
    transform mainmenu1: 
                       ^

Ren'Py Version: Ren'Py 6.15.2.281
Thank you in advance!
Image

RangerDanger
Regular
Posts: 45
Joined: Wed Jun 27, 2012 11:36 pm
Contact:

Re: Help with Animated Menus?

#2 Post by RangerDanger » Wed Jul 10, 2013 10:09 pm

Try removing the screen main_menu: that is currently above your transforms. I think that will solve your problem.

User avatar
madocallie
Regular
Posts: 44
Joined: Tue May 14, 2013 1:57 am
Completed: Bad Faith (DEMO), When We First Met, Party Favors
Projects: Bad Faith (Full Release)
itch: madocallie
Location: UK
Discord: madocallie#2937
Contact:

Re: Help with Animated Menus?

#3 Post by madocallie » Wed Jul 10, 2013 10:16 pm

I did remove it, but it still displayed the same error message. u_u

EDIT: whoops, i mixed up! sorry;;
Last edited by madocallie on Thu Jul 11, 2013 7:46 am, edited 1 time in total.
Image

User avatar
saguaro
Miko-Class Veteran
Posts: 560
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Organization: Lucky Special Games
itch: saguarofoo
Location: USA
Contact:

Re: Help with Animated Menus?

#4 Post by saguaro » Thu Jul 11, 2013 7:45 am

I noticed your indentation is off, but I don't know if that would cause this error. Looks like those transforms are indented 8 instead of 4.

User avatar
madocallie
Regular
Posts: 44
Joined: Tue May 14, 2013 1:57 am
Completed: Bad Faith (DEMO), When We First Met, Party Favors
Projects: Bad Faith (Full Release)
itch: madocallie
Location: UK
Discord: madocallie#2937
Contact:

Re: Help with Animated Menus?

#5 Post by madocallie » Thu Jul 11, 2013 8:03 am

I managed to partially create the animation! Thank you! ^u^

However, now, a new problem arises.

Firstly, I wish to have the screen black before the transforms of the menu come on.

And secondly, when the menu is completed, it doesn't respond to my clicking, hover, play music etc. etc.
In other words, I can't get anywhere on the menu, it's just frozen there as a completed menu.

Here's the code:

Code: Select all

# Main Menu 
#
# Screen that's used to display the main menu, when Ren'Py first starts
# http://www.renpy.org/doc/html/screen_special.html#main-menu



transform mainmenu1: 
        alpha 0.0
        linear 1.0 alpha 1.0

transform mainmenu2: 
        alpha 0.0
        2.0
        linear 1.0 alpha 1.0

transform mainmenu3: 
        alpha 0.0
        3.0
        linear 1.0 alpha 1.0
        
transform mainmenu4: 
        alpha 0.0
        4.0
        linear 1.0 alpha 1.0
        
        
screen main_menu:
        add "into1.png" at mainmenu1
        add "into2.png" at mainmenu2
        add "into4.png" at mainmenu3
        imagemap at mainmenu4:
    
    
         ground "into 3.png"
         hover "into 3.png"
         idle "into 3.png"
         selected_idle "into 3.png"
         selected_hover "into 3.png"
        
          hotspot (0,98,284,70) action Start()
          hotspot (0,182,312,65) action ShowMenu("load")
          hotspot (0,263,339,68) action ShowMenu("preferences")
          hotspot (0,344,366,66) action Start()
          hotspot (607,460,192,50) action Help()
          hotspot (578,524,221,51) action Quit(confirm=True)
Image

Post Reply

Who is online

Users browsing this forum: No registered users