Open Geokureli opened 1 year ago
Would this be a change to FlxText, as in dropping new code into the class itself? If so, that would save a lot of time having to update different examples and add-ons and any other library that uses FlxText directly.
likely no, in the long run if FlxBitmapTExt surpasses FlxText in usage it would be changed in phases:
and each phase should have some time between them so people don't get whiplash
Edit: Accidentally hit close
small note to self / others, this web based font -> bitmap font generator is pretty nice to use https://snowb.org/
and it's also open source! https://github.com/SilenceLeo/snowb-bmf/
exporting as BMFont XML
from there, and then importing using fromAngelCode()
works all good
added snowb to #2764 - External Tools
exporting as
BMFont XML
from there, and then importing usingfromAngelCode()
works all good
Does it export binary formats too? we just recently added that as an option and it's noticeably more compact than other angelcode formats
This is mainly a way to organize my thoughts, I added this to 6.0.0 issues, but that's not likely to happen.
FlxText Sucks
it looks like crap and it's performance is garbage. It's mainly used because FlxText is what people look for and it allows you to use fonts and it displays any character. This brings me to the cold hard truth: FlxBitmapText sucks even harder. While it renders pixel text with pixel-perfect crispness, you need to pre-render a bitmap of every character you'll need. With input text, this may need to include all international characters
Can we generate these bitmap fonts for you?
Drawing text to bitmaps works pretty well outside of html5. In non-web targets we could render the font atlas in real time whenever new characters are requested. in html5 we could generate atlases at compile time via macros. additionally, once multisheet atlases
this might be overkill, a simpler solution is to popularize something like Angelcode's BMFont tool that converts ttf files to bitmap fonts. I think BM font can be run via terminal commands, so maybe that's a route to go.
more info incoming
related: https://github.com/HaxeFlixel/flixel/issues/2710