Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlxBitmapText doesn't split words longer than the fieldWidth #2531

Closed
Geokureli opened this issue Apr 9, 2022 · 0 comments · Fixed by #2722
Closed

FlxBitmapText doesn't split words longer than the fieldWidth #2531

Geokureli opened this issue Apr 9, 2022 · 0 comments · Fixed by #2722
Milestone

Comments

@Geokureli
Copy link
Member

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):
image

How it appears:
Screen Shot 2022-04-08 at 11 28 39 PM

when wrapByWord is false:
image

How the original code should look by default:
Screen Shot 2022-04-08 at 11 29 49 PM

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

@Geokureli Geokureli added this to the 5.0.0 milestone Nov 2, 2022
@Geokureli Geokureli modified the milestones: 5.0.0, 6.0.0 Nov 20, 2022
@Geokureli Geokureli modified the milestones: 6.0.0, 5.6.0 Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant