Here's how it looks:
And here's the code:
Code: Select all
screen input_box(message, variable_name, done=Return(True)):
modal True
frame:
left_padding 20 top_padding 20 right_padding 20 bottom_padding 20
xalign 0.5 yalign 0.5
vbox:
spacing 10
text message
frame:
xalign 0
xsize 320
input value VariableInputValue(variable_name,returnable=True)
textbutton _("Confirm"):
xalign 0.5
action done
Code: Select all
default mc_name = "Hans"
define mc = Character("mc_name", who_color="#EB5", dynamic=True)
Code: Select all
label naming:
call screen input_box("Name your character:", "mc_name") # call function stops the rest of the game until the function is returned
$ mc_name = mc_name.strip() # strip whitespace at start and end of input
mc "I'm alive!"
And that's it. I hope you found this useful