`
zhujianjia
  • 浏览: 478032 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

转:AndEngine中的字体加载及应用

阅读更多

AndEngine中的字体加载及应用

 

 

 

AndEngine中的字体加载及应用

public void onLoadResources() {


this.mTexture1 = new Texture(256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
FontFactory.setAssetBasePath("font/");
this.mPlokFont = FontFactory.createFromAsset(this.mTexture1, this, "Plok.ttf", 30, true, Color.BLACK);
this.mEngine.getTextureManager().loadTexture(this.mTexture1);
this.mEngine.getFontManager().loadFonts(this.mPlokFont);
}


public Scene onLoadScene() {
this.mEngine.registerUpdateHandler(new FPSLogger());


final Scene scene = new Scene(1);
scene.setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f));


scene.getTopLayer().addEntity(new Text(140, 300, this.mPlokFont, "hello!"));


return scene;
}

 

 

 

转自:http://361tg.net/read.php?17

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics