Hello everyone!
I'd like to put automated Break Lines on a specific message text.
I don't know if the message will be just 1 word of 3 letters or a long word of 100 letters.
What's the best way to display it on a message? Is there a way to script code it --> break line every X letters?
one of yanfly's messaging plugins adds a wordwrap feature that does this automatically.
Yes I know, but it conflicted with other plugins.
I'd like to just call a small script code with the window with text and an auto-breaklines, it's for a single message box.
this is pretty easy to do if you know any js. search "word wrap in javascript" ... take that function and send your message through it, then use $gameMessage.add(wrappedLine)
automatic breaklines don't work that way.
you can either use a manual break, or you'll need a wordwrap type plugin for automatic function.
As a general tip, only telling us that something "won't work" does very little to help us help you. It could be anything, starting from your code not even being executed (you didn't tell us how you call that piece of code) to any number to possible errors in your code. Like is str even defined? Or do you get some kind of "can't access property replace of undefined" error on the console? Maybe there is an error with your RegEx? Maybe everything in your first line is fine, but you simply try to add your surname at the wrong time or with the wrong function?
If you want to get help, you need to provide us with more detail on what exactly doesn't work.
That was the help I needed ! Thank you very much!