I use Text in Andengine and KozGoPr6N-Heavy. I use it in this way

Font font = FontFactory.createFromAsset(activity.getFontManager(), activity.getTextureManager(),256, 256, activity.getAssets(), "font/KozGoPr6N-Heavy.otf", 60, true, Color.WHITE);
font.load();
timerLabel = new Text(-90, 0, font, Integer.toString(0), 6, activity.getVertexBufferObjectManager());

But effect is not as I expect, it looks like chopped on left.

enter image description here

Any idea why?

有帮助吗?

解决方案

Show us how you use your FontREgion. You probably use TextureOptions.DEFAULT while TextureOptions.BILINEAR will be better choice.

This is how I create font, you should do similiar:

public void loadMenuFonts(){
FontFactory.setAssetBasePath("font/");
final ITexture mainFontTexture = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);

mainFont = FontFactory.createStrokeFromAsset(activity.getFontManager(), mainFontTexture, activity.getAssets(), "mainFont.ttf", 30, true, Color.WHITE, 2, Color.rgb(22, 144, 189));

mainFont.load();
}

Notice that I use createStrokeFromAsset but you can simply use createFromAsset instead which is almost the same but the effect is font without stroke.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top