Godot Version
4.5.1 stable
TextEdit not working on mobile
My problem is similar, but not identical to this and might be identical to this.
My goal:
I’m building a character creator game where the user can generate a character from a bunch of options, and give them a name.
For the name, I have a LineEdit where the user can input a name, which then gets passed to a variable, and a label that displays the variable when in photo mode.
My relevant code:
func _on_line_edit_text_changed(new_text: String) -> void: # signal connected for text_changed
myVariable = new_text
func _on_go_export(): # gets called when i go to the photo mode screen
%Label.text = myVariable
This works fine on a web export if opened on a PC browser. But when opened on mobile, the label just displays what was previously in the variable (the default name).
Similar questions cite as a solution to enable “Experimental Virtual Keyboard“ in the export settings. Before i did that, my keyboard was showing, but the LineEdit accepted no text (line stayed blank). With this setting enabled, typing into the text edit works now, BUT not saving the text input…
Anyone got an idea what’s going wrong? I assume the text input in the LineEdit doesn’t get recognized as changed, despite showing text, so it doesn’t get stored in the variable?! (Is there a way to test whether the variable gets written while on mobile? i can’t do a print on a web build, right?)
Is there a solution, or a workaround that’s not super advanced? (i’ve only been programming for half a year, there’s a lot i don’t understand yet, so a simple solution or workaround would be amazing!)