I am going mad trying to sort some basic problems with native.newTextbox.
All I want to do is let the user type in a paragraph of text and then
a) check the length of the text against a maximum value whilst they are typing and stop them when they reach the limit.
b) catch them typing return and delete the return (ie don’t let them enter a newline in the text (the text wraps ok without).
Ive tried many many suggestions from the user forum and none of them actually work. In essence they all suggest that in the phase = “editing” there are several properties available that can be manipulated:
event.newCharacters, event.oldText, event.text to be specific. What I find is that these are all as described but do not actually affect the contents of the inputbox, for example if I limit the text length by checking the length of event.text and when it exceeds my maximum length I set event.text = event.oldText (even if using intermediate variables, setting event.text to anything doesn’t affect the actual text in the box.
With regard to the newline character, the event.newCharacter doesn’t show it. when you type a backspace or a return in a textbox event.newCharacter is empty.
Am I missing something here? I
I realise you can write a whole lotta games without any text entry, but there must be a way of validating the text on entry.