Page 2 of 4
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 1:11 pm
by philat
I presume what OP wants is multiple input fields that the user can click on to focus and type in directly in the field. Roughly similar to what is described here:
http://lemmasoft.renai.us/forums/viewto ... =8&t=29210
I have nothing to add to the conversation in terms of how to do it (never thought about it), but thought since this thread is going in circles...
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 1:39 pm
by namastaii
Wait, that's where I got my original ui.input idea anyway, but nobody could help that guy either D:
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 1:46 pm
by namastaii
Code: Select all
hbox xpos 200 ypos 200:
vbox:
frame:
hbox:
input default "hi"
$ first_name = input
This works. with a button look. BUT if i add focus like so:
Code: Select all
hbox xpos 200 ypos 200:
vbox:
frame:
hbox:
focus input default "hi"
$ first_name = input
It turns into a tiny dot and it doesn't work
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 1:50 pm
by xela
So what you want is textbox that is always visible that you can type into at any time just by clicking on it?
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 2:08 pm
by xela
You could try something like this:
Code: Select all
init python:
def func(newstring):
store.var = newstring
screen input_testing():
input default "hi" changed func
label start:
$ var = "meow"
show screen input_testing
"[var]"
"[var]"
"[var]"
"[var]"
"[var]"
"[var]"
"[var]"
"[var]"
It will not freeze the game and you can type whenever you please.
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 2:35 pm
by xela
This works really well:
Code: Select all
init python:
def func(newstring):
store.var = newstring
screen input_testing():
button:
id "Meow"
xysize (300, 25)
action NullAction()
add Input(default=var, changed=func, button=renpy.get_widget("input_testing", "Meow")) yalign 1.0
label start:
$ var = "Meow"
show screen input_testing
"[var]"
"[var]"
"[var]"
"[var]"
"[var]"
"[var]"
"[var]"
"[var]"
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 2:40 pm
by xela
namastaii wrote:The problem with that is that is ren'py language. Which means I can't mix the ui python screen with ren'py statements. Plus, that input statement doesn't have button capability XD
And you can mix them... there is absolutely nothing preventing that. It's just that ui module is pretty much obsolete at this point and ui.input is nothing but a reference to Input class from behavior file anyway.
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 5:56 pm
by namastaii
Thank you, I'm about to try it out.
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 6:10 pm
by namastaii

weird
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 6:11 pm
by namastaii
hold on,I think i know why XD
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 6:12 pm
by namastaii
Thank you. It only works when the mouse is hovered over it though. Is that kinda weird?
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 6:33 pm
by namastaii
Yeah, instead of clicking on it, i have to put my mouse over it but if i move the mouse, i can't type in it anymore XD weird, since it says button...
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 11:03 pm
by xela
namastaii wrote:Yeah, instead of clicking on it, i have to put my mouse over it but if i move the mouse, i can't type in it anymore XD weird, since it says button...
I wrote earlier that it's how it is coded to work...
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 11:06 pm
by namastaii
Ah, okay. Do you know how I could make it so even if it's not focused on a text input, that it'll still be focused on the last one it WAS focused on so if they do type something it will appear in the last box they had selected? the only reason i ask is because thats how Magical Diarys character creation screen is like. But if not, I'm sure it's not a big deal. I really appreciate you fixing this for me thanks ^^
Re: How to change ui.input into a button?
Posted: Sat Mar 14, 2015 11:52 pm
by xela
I once again do not understand what you're asking
I'll download the demo to see how it works there...