viewtopic.php?f=51&t=38080
Before, I was trying to figure out how to put a text input on screen, instead of in the dialogue. I figured I'd share what worked for me, in case you'd like to use it for your visual novels.
Here is a simple example:
This is the exact code for the example above:
Code: Select all
init python:
def name_func(newstring):
store.firstname = newstring
def lastname_func(newstring):
store.lastname = newstring
Code: Select all
screen name_input():
imagemap:
ground "gui/clipboard.png"
hbox xalign 0.6 yalign 0.20:
text "{color=#000000}First Name:"
button:
id "name_input1"
xysize (250, 25)
action NullAction()
add Input(size=30, color="#ff0066", default=firstname, changed=name_func, length=10, button=renpy.get_widget("name_input","name_input1")) yalign 1.0
hbox xalign 0.6 yalign 0.30:
text "{color=#000000}Last Name:"
button:
id "name_input2"
xysize (250, 25)
action NullAction()
add Input(size=30, color="#ff0066", default=lastname, changed=lastname_func, length=10, button=renpy.get_widget("name_input","name_input2")) yalign 1.0
It's up to you how you continue from the text input, but it's tested and works. The inputs are saved. I hope this was somewhat helpful.
If you maybe want something like a button to open this screen, you can do this:
Code: Select all
screen name_input_button():
button xalign 0.3 yalign 0.12:
text "[firstname]"
action ui.callsinnewcontext("name_input_label")
You could move these around to create something more unique, as well.