So forever ago I agreed to put up a cookbook version of an on-screen text input but I put it off for a while so I just whipped up a really simple version that you should easily be able to spice up to your games standards. Any questions or errors, please let me know.
You can change around the positions, use images and make it look super cool.
This text input works by hovering over the box and then typing while your cursor is still over the box. Then you can move your cursor to the next box to begin typing there. You don't need to click. Though if anyone knows the specific code to make it so you click instead of hover, please also let me know about that
I will paste the code into here but I will also upload the files for you to manipulate directly.
This simple version looks like this: Define the functions for creating the string and also the variables you will be assigning the strings to
Code: Select all
init python:
def name_func(newstring):
store.firstname = newstring
def lastname_func(newstring):
store.lastname = newstring
init:
default firstname = " "
default lastname = " "
Code: Select all
screen open_screen:
textbutton "open" action Show("text_input_screen")
Code: Select all
screen text_input_screen():
frame:
#xysize (300,200)
xpos 250
ypos 100
vbox:
hbox:
text "{size=+5}First Name"
button:
id "input_1"
xysize (250,25)
action NullAction()
#hover_sound ""
add Input(hover_color="#3399ff",size=28, color="#000", default=firstname, changed=name_func, length=10, button=renpy.get_widget("text_input_screen","input_1")) yalign 1.0
hbox:
text "{size=+5}Last Name"
button:
id "input_2"
xysize (250,25)
action NullAction()
#hover_sound ""
add Input(hover_color="#3399ff",size=28, color="#000", default=lastname, changed=lastname_func, length=10, button=renpy.get_widget("text_input_screen","input_2")) yalign 1.0
hbox:
textbutton "Done" action Hide("text_input_screen")
Click to type version: first version: