text box

I have a very long text line and I wan to make a multiline paragraph with it. Right now I’m inserting ‘\n’ characters to split it in multiples lines, but some times this method breaks a word in the middle. So there is a method to do something like a text box, that respect the length of a word before insert the new line character?


I solved using find and replace to insert the new line characters:

 for(int i = 50; i < textLine.length(); i= i + 60){  
        cout << "i " << i << endl;  
        int pos = textLine.find(' ', i);  
        if(pos != string::npos){  
            cout << "true!!!" << endl;  
            textLine.replace(pos, 1, "\n");  

Nice post! This is what i am exactly searching for! Thank you for sharing, zea… :slight_smile:

Another approach to solve this problem is this addon:


check it!