1

If I have a UI with a .atlas and a BitmapFont with a .atlas is there a simple way to combine these into one or do I have to merge them myself in a image file and manually offset all the elements in the combined .atlas to the correct position? It is doable manually but kinda tedious, and if there is a slight calculation error one might have to redo every position and/or size.

Madmenyo
  • 7,643
  • 6
  • 46
  • 88

1 Answers1

4

Yes you can! Just let TexturePacker do the packing work for you:

  1. Put the BitmapFont's .png file in the same folder where TexturePacker reads your images to pack. The same folder where all the other images are
  2. Put the BitmapFont's .fnt file in the same folder where your skin's .atlas file is (usually in the assets folder inside android project)
  3. Refresh the assets folder in eclipse (just in case..)
  4. Now you can use the Bitmap font in the styles.json, like for example:

    com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: somefont.fnt } }

donfuxx
  • 10,696
  • 6
  • 41
  • 74