4

それが私がそれをやろうとした方法です:

fontTextureAtlas = new BitmapTextureAtlas(1024, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
font = FontFactory.createFromAsset(fontTextureAtlas,this,"times.ttf",45f,true,Color.WHITE);
getEngine().getTextureManager().loadTexture(fontTextureAtlas);

そして、コードで:

Text text = new Text(10,10, font,"Some text");
scene.attachChild(text);

そして、私が見るのはこれだけです:

テキストの代わりに黒いブロック

またnew Font(fontTextureAtlas,Typeface.DEFAULT,45f,true,Color.WHITE);、 を初期化するために使用しようとしましたfontが、結果はほぼ同じでした。

誰かが私が間違ったことを知っていますか?

4

3 に答える 3

10

font.load();後に 追加してみてくださいgetEngine().getTextureManager().loadTexture(fontTextureAtlas);

それがうまくいかない場合は試してみてください

getEngine().getFontManager().loadFont(font);
于 2012-07-16T13:35:46.517 に答える
2

http://stuartmct.co.uk/2012/07/16/andengine-creating-and-using-text /

于 2012-07-19T12:03:26.563 に答える