How in the world do you create a custom front? Almost straight from the example:
BitmapTextureAtlas font_texture = new BitmapTextureAtlas(this.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
mFont = FontFactory.createFromAsset(font_texture, this, "comic.ttf", 18f, true, Color.WHITE);
Yet I get this error:
The method createFromAsset(FontManager, ITexture, AssetManager, String, float, boolean, int) in the type FontFactory is not applicable for the arguments (BitmapTextureAtlas, TestGFX5Activity, String, float, boolean, Color)
I've tried many different combinations and can't get anything to work. I want the font "comic.ttf", size 18, and white. How do I do this and not get that error?
Finally found the answer:
final ITexture fontTexture = new BitmapTextureAtlas(this.getTextureManager(),256,256);
mFont = FontFactory.createFromAsset(this.getFontManager(),fontTexture,this.getAssets(),"COMIC.TTF",18f,true,Color.WHITE);
But you must import android.graphics.Color not org.andengine.util.color.Color!!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With