Even with the recent updates on the engine I'm still having issues when showing text on screen. It's frequent that some letters are not showing up on screen. I'm reusing 2 font resources with 6 text objects. I believe when I use the resource more than once, the letters do not show up for the other text objects.
My code...
Using java Syntax Highlighting
- @Override
- public void onLoadResources() {
- // ...
- // text
- FontFactory.setAssetBasePath("font/");
- this.mFontTexture = new Texture(256, 128, TextureOptions.BILINEAR);
- this.mFontScore = FontFactory.createFromAsset(this.mFontTexture, this, "UnrealTournament.ttf", textSize1, true, Color.WHITE);
- this.mEngine.getTextureManager().loadTexture(this.mFontTexture);
- this.mEngine.getFontManager().loadFont(this.mFontScore);
- //
- this.mFontTexture = new Texture(256, 128, TextureOptions.BILINEAR);
- this.mFontMenu = FontFactory.createFromAsset(this.mFontTexture, this, "UnrealTournament.ttf", textSize2, true, Color.WHITE);
- this.mEngine.getTextureManager().loadTexture(this.mFontTexture);
- this.mEngine.getFontManager().loadFont(this.mFontMenu);
- // ...
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
then at different location of the code I use the resource...
Using java Syntax Highlighting
- // ...
- textIns1 = new Text(x, y, this.mFontScore, "Capture:", HorizontalAlign.LEFT);
- // ...
- textIns2 = new Text(x, y, this.mFontScore, "Avoid this:", HorizontalAlign.LEFT);
- // ...
- textIns2 = new Text(x, y, this.mFontScore, "Avoid these:", HorizontalAlign.LEFT);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
