Combined name + pronoun selector screen

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
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Combined name + pronoun selector screen

#1 Post by chesarty »

So I'd like to have a screen at the start of your game where you select your character's name and pronouns, something like this incredible mockup I made lol.
Illustration2.png
basically input line for the name, (image)buttons for the pronoun selector and moving forward with the start button

How would one go about doing this? I know how to do the name and pronoun selection in separate lines/screens but I've never tried combining them like this.
The simpler the better :oops:

henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: Combined name + pronoun selector screen

#2 Post by henvu50 »

this code lets player enter name

Code: Select all

label start: 
    define pov = Character("[povname]")

    python:
        povname = renpy.input("What is your name?", length=32)
        povname = povname.strip()

    if not povname:
         povname = "Pat Smith"

pov "My name is [povname]!"

from: https://www.renpy.org/doc/html/input.ht ... enpy.input

Get the above working first. make sure indentation is correct.

Then use textbutton to change the pronoun variable.
https://www.renpy.org/doc/html/screens.html#textbutton (you'll use this link a lot as reference, it's how to make a window and put buttons in it.

Code: Select all


default mcPronoun = ""

screen textbutton_screen():
    vbox:
        textbutton "He/Him" action SetVariable("mcPronoun ", "hehim")
        textbutton "She/Her" action SetVariable("mcPronoun ", "sheher")
        textbutton "They/Them" action SetVariable("mcPronoun ", "theythem")

"pronoun for mc is [mcPronoun]"

ask more questions if needed.

User avatar
emz911
Regular
Posts: 103
Joined: Fri Jun 23, 2017 2:23 pm
Contact:

Re: Combined name + pronoun selector screen

#3 Post by emz911 »

In addition to the last answer, it seems like you want an input in screens rather than in labels, so this is what you need: https://renpy.org/doc/html/screens.html ... nput#input
Then combine it with the textbuttons into the same screen.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot