REPLACE TEXT IN TEXTFIELD

Good afternoon,

I am trying to use a textfield to be able to make a description of a profile, this description must be of maximum 150 characters. Similarly when it is finished writing and enter, replace a text, the problem that I really have is that when replacing in the text (object.text = newField.text) I need the text to be distributed in three lines or so least do a “\ n” every fifty characters. But I do not know how to do it. I do not append code of this, because I do not know how to start. Thanks for any help.

You can use the standard newText to create multi-line text https://docs.coronalabs.com/api/library/display/newText.html

You can add a maximum width for the text to wrap to. As for the 150 character limit, you can add a string.len() check to the text input function, e.g. if string.len( object.text ) < 150 then, and only add new characters if that requirement is met.

You can use the standard newText to create multi-line text https://docs.coronalabs.com/api/library/display/newText.html

You can add a maximum width for the text to wrap to. As for the 150 character limit, you can add a string.len() check to the text input function, e.g. if string.len( object.text ) < 150 then, and only add new characters if that requirement is met.