Closed subdan closed 8 years ago
The reason for this issue is that the text is drawn into a MeshBatch
in order to provide the maximum performance. And all quads that are added to a MeshBatch need to reference the same texture. The empty texture you're adding is just ignored; the batch can't work with that. Instead, it references the font texture, and that's what you're seeing.
My recommendation for what you want to achieve: use BitmapFont.createSprite
instead. You'll get a sprite where each glyph is one image. Use placeholders for the positions where you want to show the fractions; then replace those placeholders with the manually created fraction symbols.
However what's happening inside fillMeshBatch
is intentional — so this is not a bug. I'll close this issue.
Thank you, Daniel.
I want to modify the BitmapFont class to dynamically generate some characters. I want to display a fraction instead of special symbols. For example: I want to display this text: Some Ӑ text as:
Inside parseFontXml method I found a loop:
I added a condition:
I see the next picture:
It's a TextField:
var tf:TextField = new TextField(400, 100, "Some Ӑ text");
I replace Ӑ symbol with empty Texture.Why I see a font texture atlas instead of empty space?
In the future I will replace Texture.fromEmpty to RenderTexture. Inside RenderTexture I will combine 3 Image: numerator, denominator and separator.
This bug appears in all versions of Starling.