As this post title suggest, font of the scene become disappear when same scene call more than two time.

Following code I used for creating font.

 mNumberFontTexture = new BitmapTextureAtlas(
                            alienAttack.getTextureManager(), 256, 256);
 numberFont = new Font(alienAttack.getFontManager(), mNumberFontTexture,
                            Typeface.create(Typeface.DEFAULT, Typeface.BOLD), 52, true,

Based on requirement I load a font texture as per the following way.

    public void loadLevelSelectGraphics() {

    public void unloadLevelSelectGraphics() {

I am using scene base approach for developing game. Please suggest me in which thing I am doing mistake. Thanks for your effort.


Screenshot represent the problem which was occur after multiple load and unload font method.

Font Bug

  • \$\begingroup\$ By dissapear you mean letters become black squares or completely dissapear? \$\endgroup\$ – MartinTeeVarga Jun 12 '13 at 11:18
  • 1
    \$\begingroup\$ Letter become completely disappear sometime or become multicolor box region sometime. Thanks for your reply. At least you show some courage to answer. \$\endgroup\$ – Siddharth Jun 12 '13 at 17:19
  • \$\begingroup\$ If you want then I can post a screenshot also so you can better understand. Because I am working with long time with this engine and first time got this type of problem. So any how I want to detect what was going wrong. \$\endgroup\$ – Siddharth Jun 13 '13 at 4:02
  • 1
    \$\begingroup\$ Maybe screenshot, but post when do you call the load and unload methods. I think the problem will be there. \$\endgroup\$ – MartinTeeVarga Jun 13 '13 at 4:06
  • \$\begingroup\$ Within few minutes I will post screenshot. \$\endgroup\$ – Siddharth Jun 13 '13 at 4:07

This happened to me in AndEngine when I loaded the texture but forgot to unload it. If I load it too many times, then the memory is full, new texture doesn't get loaded and this happens - the texture regions point to some garbage.

If it happens only after some time, it might be the case. To debug it, write a message to log on each load and each unload and make sure you load and unload the same number of times.

Also it can be another texture that fills the memory. In your example, you are loading levelSelectBitmapTextureAtlas.load(); but you are not unloading it. It might have filled your memory and there is no more space for the font.

  • \$\begingroup\$ This type of problem occur because I forgot to enter following line of statement in my unload graphics method. mNumberFontTexture.load(); But now another problem arise that I mention in other question. \$\endgroup\$ – Siddharth Jun 14 '13 at 3:24
  • \$\begingroup\$ No this way I don't able to get my solution. Sorry for my misconception. \$\endgroup\$ – Siddharth Jun 14 '13 at 4:11
  • \$\begingroup\$ I up vote you answer because I got some concept from you answer that become useful to me in future. \$\endgroup\$ – Siddharth Jun 14 '13 at 4:20
  • \$\begingroup\$ If it did not help you but you have fixed it, please post your solution and accept it as an answer. \$\endgroup\$ – MartinTeeVarga Jun 16 '13 at 7:45
  • \$\begingroup\$ No, at present I didn't found solution for my question. But if I don't perform any loading and unloading of font for game then it is working. So I think I don't have to unload it up till I won't found any solution. \$\endgroup\$ – Siddharth Jun 16 '13 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.