FlxBitmapTextField only showing black sprites instead of text

18 views
Skip to first unread message

Victor Fabiano

unread,
Jan 31, 2016, 6:02:57 PM1/31/16
to haxef...@googlegroups.com


Hello everyone.

Today I've been trying to use FlxBitmapTextField to show bitmap fonts.
It's weird that it only shows this:



Check the code out:


   var letters:String = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!?\"#%&'()*+,-./[]\\0123456789";
   font = new PxBitmapFont().loadPixelizer(Assets.getBitmapData(AssetPaths.gamefont__png), letters);
   bmt = new FlxBitmapTextField(font);
   bmt.setPosition(50, 50);
 
   bmt.text = "Hello World!\nand this is\nmultiline!!!";
   bmt.fixedWidth = false;
   bmt.multiLine = true;
   bmt.lineSpacing = 8;
   bmt.padding = 0;
   add(bmt);


And here's my bitmap font:

I'm trying to use it because FlxText gets blurred on html5 which is my target platform.
I tested it on flash and html5, and my current game resolution is this:

gameWidth = 240;

gameHeight = 160;


Thanks in advance and I'm sorry if I'm making a stupid mistake! 

Message has been deleted

Victor Fabiano

unread,
Jan 31, 2016, 6:54:39 PM1/31/16
to HaxeFlixel


Alright, after messing around with my FlxBitmapTextField fontScale I got this:



I think I might be missing something... 

What is the correct size of image to use? I'm using a 128x128 image with 8x8 tiles. 



Reply all
Reply to author
Forward
0 new messages