4

いったいどのようにしてカスタムフロントを作成しますか?例からほぼまっすぐ:

BitmapTextureAtlas font_texture = new BitmapTextureAtlas(this.getTextureManager(), 256, 256, TextureOptions.BILINEAR); 
    mFont = FontFactory.createFromAsset(font_texture, this, "comic.ttf", 18f, true, Color.WHITE);

しかし、私はこのエラーを受け取ります:

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)

私は多くの異なる組み合わせを試しましたが、何も機能しません。フォント「comic.ttf」、サイズ18、白が必要です。これを実行してエラーが発生しないようにするにはどうすればよいですか?

4

1 に答える 1

9

最終的に答えを見つけました:

final ITexture fontTexture = new BitmapTextureAtlas(this.getTextureManager(),256,256);

mFont = FontFactory.createFromAsset(this.getFontManager(),fontTexture,this.getAssets(),"COMIC.TTF",18f,true,Color.WHITE);

ただし、 org.andengine.util.color.Colorではなくandroid.graphics.Colorをインポートする必要があります!!!

于 2012-07-02T07:02:07.840 に答える