读书人

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

发布时间: 2012-08-11 20:50:31 作者: rapoo

转: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

读书人网 >移动开发

热点推荐