Including a notebook with player input [solved]

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
lacticacid
Regular
Posts: 36
Joined: Fri Nov 23, 2018 6:44 pm
Contact:

Including a notebook with player input [solved]

#1 Post by lacticacid »

Hi! I'd like my game to have a notebook screen in which the player can type out notes for later use. How should I go about it?
Last edited by lacticacid on Wed Mar 13, 2019 7:10 am, edited 1 time in total.
~There is almost always a better, easier way to approach a problem.~

User avatar
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Re: Including a notebook with player input

#2 Post by Nanahs »

Hello! There's probably a better way to do it.
But whenever I need to do something like this I use renpy.imput.

For example.
You create the label and in "scene" you use an image of a notebook as background.

Code: Select all

label notebook:
    scene notebook

    while chooseaname == "":
        $ chooseaname = renpy.input("Type Your Text").strip()
Or:

Code: Select all

    while chooseaname == "":
        $ chooseaname = renpy.input("").strip()


You can name this "chooseaname" anything you want. Like "Text1", etc.
This "renpy.imput" code will allow the player to type a text.
Whatever they type will be saved as "chooseaname" (or the name you choose :lol: ).

Then for you to show this text you can create a screen.
Like this:

Code: Select all

screen notebooktext1:
    text "{color=#00ffff} [choosename] {/color}" size 35 xalign 0.5 ypos 150
You don't need to change the text color or anything. I just gave an example.
In "size" you can change the text size. You can also the choose position you want it to be in the screen, etc.
You can customize it all in your way.

Now to show it, you use "show screen" in the label you want it to show up:

Code: Select all

label text1:
    scene notebook
    show screen notebooktext1
Once the player type something on "choosename", their text will always show up when you use it.

So if you need to "erase" it, do this:

Code: Select all

    $ choosename=""
That's it. I'm not an expert, but it has worked for me :)

lacticacid
Regular
Posts: 36
Joined: Fri Nov 23, 2018 6:44 pm
Contact:

Re: Including a notebook with player input [solved]

#3 Post by lacticacid »

viewtopic.php?t=47149 Just found this thread. Exactly what I needed.
~There is almost always a better, easier way to approach a problem.~

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Including a notebook with player input

#4 Post by isobellesophia »

Nanahs wrote: Sat Jan 05, 2019 4:46 pm Hello! There's probably a better way to do it.
But whenever I need to do something like this I use renpy.imput.

For example.
You create the label and in "scene" you use an image of a notebook as background.

Code: Select all

label notebook:
    scene notebook

    while chooseaname == "":
        $ chooseaname = renpy.input("Type Your Text").strip()
Or:

Code: Select all

    while chooseaname == "":
        $ chooseaname = renpy.input("").strip()


You can name this "chooseaname" anything you want. Like "Text1", etc.
This "renpy.imput" code will allow the player to type a text.
Whatever they type will be saved as "chooseaname" (or the name you choose :lol: ).

Then for you to show this text you can create a screen.
Like this:

Code: Select all

screen notebooktext1:
    text "{color=#00ffff} [choosename] {/color}" size 35 xalign 0.5 ypos 150
You don't need to change the text color or anything. I just gave an example.
In "size" you can change the text size. You can also the choose position you want it to be in the screen, etc.
You can customize it all in your way.

Now to show it, you use "show screen" in the label you want it to show up:

Code: Select all

label text1:
    scene notebook
    show screen notebooktext1
Once the player type something on "choosename", their text will always show up when you use it.

So if you need to "erase" it, do this:

Code: Select all

    $ choosename=""
That's it. I'm not an expert, but it has worked for me :)

Thank you Nanahs! looking this for a month.
I am a friendly user, please respect and have a good day.


Image

Image


Post Reply

Who is online

Users browsing this forum: No registered users