문제

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