Multiple Choice 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
User avatar
Coren
Mindscrew Driver
Posts: 1691
Joined: Fri Sep 18, 2009 9:24 am
Completed: Dear Mariko, Six Rules, Ribbon of Green, RE: Prince of Nigeria, Doppelganger, Cole's Gate Demo, Crimson Rafflesia Demo, Mica: Apoptosis Demo
Projects: Crimson Rafflesia, Mica: Apoptosis, Fantasy Euthanasia
Organization: Soyasushi Productions
Tumblr: CorenBaili
Deviantart: CorenB
Skype: coren.baili
Contact:

Multiple Choice Menu

#1 Post by Coren » Thu May 16, 2013 10:26 am

Is it possible to create a menu or options imagemap screen that allows the player to choose more than one option (clicking twice results in deselecting) and then click on another button to proceed? :)

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: Multiple Choice Menu

#2 Post by apricotorange » Thu May 16, 2013 1:31 pm

Here's a little example:

Code: Select all

screen multichoice:
    default pepperoni = True
    default olives = False
    default pineapple = False

    vbox:
        yalign 0.5
        textbutton "Pepperoni" xfill True action ToggleScreenVariable("pepperoni")
        textbutton "Olives" xfill True action ToggleScreenVariable("olives")
        textbutton "Pineapple" xfill True action ToggleScreenVariable("pineapple")
        textbutton "Make pizza" xfill True action Return((pepperoni, olives, pineapple))

# The game starts here.
label start:
    call screen multichoice
    if _return[0]:
        "Your pizza has pepperoni"
    if _return[1]:
        "Your pizza has olives"
    if _return[2]:
        "Your pizza has pineapple"
    return

User avatar
Coren
Mindscrew Driver
Posts: 1691
Joined: Fri Sep 18, 2009 9:24 am
Completed: Dear Mariko, Six Rules, Ribbon of Green, RE: Prince of Nigeria, Doppelganger, Cole's Gate Demo, Crimson Rafflesia Demo, Mica: Apoptosis Demo
Projects: Crimson Rafflesia, Mica: Apoptosis, Fantasy Euthanasia
Organization: Soyasushi Productions
Tumblr: CorenBaili
Deviantart: CorenB
Skype: coren.baili
Contact:

Re: Multiple Choice Menu

#3 Post by Coren » Sun May 19, 2013 3:19 am

Hmm, is it possible to create an imagemap which allows people to click and unclick stuff, with a small button at the bottom saying "confirm choices" and so on?

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: Multiple Choice Menu

#4 Post by apricotorange » Sun May 19, 2013 8:51 pm

Yes... it's almost identical to what I wrote. Just replace the textbuttons with hotspots, and make sure you define the selecte image correctly. See also http://www.renpy.org/doc/html/screens.html#imagemap and http://lemmasoft.renai.us/forums/viewto ... 51&t=14237 .

User avatar
Coren
Mindscrew Driver
Posts: 1691
Joined: Fri Sep 18, 2009 9:24 am
Completed: Dear Mariko, Six Rules, Ribbon of Green, RE: Prince of Nigeria, Doppelganger, Cole's Gate Demo, Crimson Rafflesia Demo, Mica: Apoptosis Demo
Projects: Crimson Rafflesia, Mica: Apoptosis, Fantasy Euthanasia
Organization: Soyasushi Productions
Tumblr: CorenBaili
Deviantart: CorenB
Skype: coren.baili
Contact:

Re: Multiple Choice Menu

#5 Post by Coren » Mon May 20, 2013 12:03 pm

Ah, I was just confused because there didn't seem to be a "Your pizza has pepperoni and olives" text appearance.

Post Reply

Who is online

Users browsing this forum: No registered users