Code: Select all
screen text_input_screen():
frame:
xpos 250
ypos 300
draggroup:
drag:
xpos 300 ypos 300
default screenvar = False
droppable False
imagemap:
ground "background.png"
idle "idle.png"
hover "hover.png"
selected_idle "hover.png"
hotspot (150,140,475,200) action SetScreenVariable("screenvar",True), SetScreenVariable("screenvar1",False)
if screenvar == True:
input default firstname pos(200,165) changed name_func
drag:
vbox:
ypos 400
default screenvar1 = False
imagemap:
ground "background.png"
idle "idle.png"
hover "hover.png"
selected_idle "hover.png"
hotspot (150,140,475,200) action SetScreenVariable("screenvar1",True), SetScreenVariable("screenvar",False)
if screenvar1 == True:
input default lastname pos(200,165) changed lastname_func
textbutton "Done":
xalign .5
action Return()
init python:
def name_func(newstring):
store.firstname = newstring
def lastname_func(newstring):
store.lastname = newstring
init:
default firstname = ""
default lastname = ""
start:
"And so it begins."
call screen text_input_screen()
The disappearing act is because of SetScreenVariable("screenvar",False) or SetScreenVariable("screenvar1",False) when the other box is clicked. The problem is that if I DON'T include this piece of code, I can no longer toggle back to the first box. I seem to be stuck in the second box perpetually.
Is there a way to either toggle freely back and forth between the boxes, or to keep the input text inside the one box when typing into the other?
Thanks!