I use the left font in the application on AndEngine .

I caught myself thinking that in every Activity I was re-creating a TextureBitmap for the font, and actually loading the font. Considering that the font size is from 100 to 200 for different Activity , there is a suspicion that this memory is good enough, that it can be critical for non-top devices.

How to use fonts in AndEngine?

Font loading example:

 ITexture fontTexture = new BitmapTextureAtlas( getTextureManager(), 1024, 1024, TextureOptions.BILINEAR ); Font font = FontFactory.createFromAsset( fontTexture, this, "Droid.ttf", FONT_SIZE, true, Color.BLACK ); font.load(); 
  • I think you need to create a TextureBitmap in the class constructor, or not? - abalckin
  • What class? For example, I have 6 different activites - these are 6 different classes. - SeniorJD
  • Well, let's say, 7 of the class TextureBitmapСl, for example, and divide it between the 6th others? - abalckin
  • one
    Create a singleton and declare TextureBitmap, Font and use it as much as you like) - Nuclominus

0