How come this doesn't work? Imagebuttons and 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
LiveTurkey
Regular
Posts: 109
Joined: Tue Dec 27, 2016 10:50 pm
Location: Brooklyn
Contact:

How come this doesn't work? Imagebuttons and menus

#1 Post by LiveTurkey »

Code: Select all

screen GrabAMap:

    imagebutton:
        idle "buttons/MissLondonGround.png"
        hover "buttons/MissLondonHover.png"
        action Jump ("teacher_options")
        xpos 587
        ypos 414
        
    imagebutton:
        idle "buttons/stackOfPaperGround.png"
        hover "buttons/stackOfPaperHover.png"
        action Jump ("paper_options")
        xpos 669
        ypos 402
        
    
label paper_options:
    menu:
        "Grab a map":
            jump girlFallsOver
label teacher_options:
    menu:
        "Raise your hand":
            p "I raise my hand."
The idea is that there are two imagebuttons on the background. The teacher and the stack of paper. The game should not progress until you click one of the buttons. Doing so gives you their respective menus and then the game continues forward.

However no imagebuttons are displayed and the game is not paused. Instead I go straight into the label paper options. Does anybody know how to fix this?

User avatar
Winterslice
Veteran
Posts: 230
Joined: Mon Sep 28, 2015 3:51 am
Completed: The Next World, Golem Creation Kit
Organization: Illuminated Games
Contact:

Re: How come this doesn't work? Imagebuttons and menus

#2 Post by Winterslice »

How are you accessing the screen? You need to show it, or preferably call it like so:

Code: Select all

call screen GrabAMap
before it'll do anything.

Post Reply

Who is online

Users browsing this forum: No registered users