Adding menu caption with renpy.display_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
itF
Newbie
Posts: 1
Joined: Thu Nov 23, 2017 7:34 pm
Contact:

Adding menu caption with renpy.display_menu()

#1 Post by itF »

I'm trying to do dynamic menus, but have no idea how to add captions.

Code: Select all

renpy.display_menu([("test caption",None),("test choice",1)])
Documentations says if the first choice tuple has no second item, it will be used as the caption, but what I get is a disabled option that is unclickable.
Image

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Adding menu caption with renpy.display_menu()

#2 Post by Remix »

Have you tried:

Code: Select all

renpy.display_menu( [ ("test caption",), ("test choice",1) ] )
None is likely interpreted as a second item ... it probably does len( tuple ) test rather than actually testing the value of item two.
Note: A one item tuple still has an internal comma.. (arg,) is correct (arg) is not
Frameworks & Scriptlets:

Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Re: Adding menu caption with renpy.display_menu()

#3 Post by Errilhl »

It works fine - I just tested it. It's your styling causing whatever you don't like. Mine looks like this:
using

Code: Select all

renpy.display_menu([("test caption",None),("test choice",1)])
screenshot0011.png
Currently working on: Image

philat
Eileen-Class Veteran
Posts: 1910
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Adding menu caption with renpy.display_menu()

#4 Post by philat »

If you want the default ren'py behavior of using the textbox for the caption, use a renpy.say() with interact set to False.

Post Reply

Who is online

Users browsing this forum: IrisColt