Customizing menu captions

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
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Customizing menu captions

#1 Post by zmook »

A comment in screens.rpy says that when config.narrator_menu=True, menu captions will be spoken by the narrator. Is there a way to change that to a different character?

I'd like to customize how (ie, *where*) menu captions are displayed, but I already use the narrator character a lot so it would be inconvenient to redefine it.

Or do I have to do something kludgey like hardcode the 'say' screen to test whether the 'choice' screen is currently visible?
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2402
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Customizing menu captions

#2 Post by Ocelot »

You actually can say menu caption as any character (documentation does not show it, but mentions that you can use say statement there.):

Code: Select all

define c = Character( . . . )
# . . . 
menu:
    c "What would it be?"
    "option 1":
        pass
< < insert Rick Cook quote here > >

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: Customizing menu captions

#3 Post by zmook »

Okay, I've defined a caption character that adjusts the yalign of the say window:

Code: Select all

define caption = Character(None, window_yalign=0.3) # menu


It seems to work, except for one weird glitch where an empty say window flashes at the bottom of the screen before getting redrawn at its new assigned position. This flash happens when the choice menu is shown, and again when it is dismissed. This happens in both 7.4 and 8.0. Any idea why that would happen, or is this just what happens when you try to use an undocumented feature?
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: Customizing menu captions

#4 Post by zmook »

Okay, no it has nothing to do with using an explicit caption character -- same thing is happening for me when I do a normal menu caption and try to do conditional positioning in the 'say' screen ("if renpy.get_screen("choice"): say_window_yalign = 0.3"). Seems to be something to do with how the caption and choice screens get drawn?
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: Customizing menu captions

#5 Post by zmook »

Ah, I think this was a consequence of having 'window auto' on. If renpy thinks the window is supposed to be showing when it passes from an input screen to a choice screen, it ends up flashing in its default position in the transition between the two.
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

Post Reply

Who is online

Users browsing this forum: MisterPinetree