flixel
flixel copied to clipboard
FlxBitmapText doesn't split words longer than the fieldWidth
example
var monospaceLetters:String = " !\"#$%&'()*+,-.\\0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[/]^_`abcdefghijklmnopqrstuvwxyz{|}~";
var charSize = FlxPoint.get(7, 10);
var fontMonospace = FlxBitmapFont.fromMonospace("assets/images/RetroMedievalV3.png", monospaceLetters, charSize);
var text:FlxBitmapText = new FlxBitmapText(fontMonospace);
text.scrollFactor.set(0, 0);
text.setPosition(0, 100);
text.autoSize = false;
text.width = text.fieldWidth = 84;
text.letterSpacing = -1;
text.multiLine = true;
text.text = "The quick brown fox jumps over the lazy dog, supercalaphra\ngalisticexpia\nladocious";
add(text);
font (hard to see on night mode):

How it appears:

when wrapByWord is false:

How the original code should look by default:

We should add a new field called something like wrapLongWords, or maybe make wordWrap an enum
enum abstract WordWrap(Int)
{
var CHAR;
var WORD_SPLIT_LONG;
var WORD;
}
found by @chosenCharacters