Jan_F
February 15, 2015, 9:04am
#1
Is there a way to draw text to a graphics instance, without using a textfield?
You’d probably need to use a bitmap font. I’m not sure if any libraries already exist for this? Or you could look into how TextField/Lime does it and copy that.
Yes, it is possible, but not out of the box. You just need to write your own Bitmap Font renderer.
Check this, good guy share something what you need:
To make font rendering as fast as possible on native targets, I wrote FreeType based font renderer for openfl-next (mostly) by myself. This only works on modified openfl-next and starling-openfl for now.
To minimize waste of memory for texture, I used MaxRects rectangular pakcer provided by relaxguy: http://www.openfl.org/archive/community/programming-haxe/gm2d-rectangle-packing-class/ This font renderer caches font glyphs into OpenGL texture as needed, while original implementation of lime's …