Including a notebook with player input [solved]
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.
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.
-
- Regular
- Posts: 36
- Joined: Fri Nov 23, 2018 6:44 pm
- Contact:
Including a notebook with player input [solved]
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.~
Re: Including a notebook with player input
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.
Or:
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 ).
Then for you to show this text you can create a screen.
Like this:
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:
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:
That's it. I'm not an expert, but it has worked for me
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()
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 ).
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
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
So if you need to "erase" it, do this:
Code: Select all
$ choosename=""
-
- Regular
- Posts: 36
- Joined: Fri Nov 23, 2018 6:44 pm
- Contact:
Re: Including a notebook with player input [solved]
viewtopic.php?t=47149 Just found this thread. Exactly what I needed.
~There is almost always a better, easier way to approach a problem.~
- 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
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.
Or:Code: Select all
label notebook: scene notebook while chooseaname == "": $ chooseaname = renpy.input("Type Your Text").strip()
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 ).
Then for you to show this text you can create a screen.
Like this:
You don't need to change the text color or anything. I just gave an example.Code: Select all
screen notebooktext1: text "{color=#00ffff} [choosename] {/color}" size 35 xalign 0.5 ypos 150
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:
Once the player type something on "choosename", their text will always show up when you use it.Code: Select all
label text1: scene notebook show screen notebooktext1
So if you need to "erase" it, do this:
That's it. I'm not an expert, but it has worked for meCode: Select all
$ choosename=""
Thank you Nanahs! looking this for a month.
Who is online
Users browsing this forum: No registered users