1
\$\begingroup\$

I am using libGDX and apparently the only way I see for creating a UI is with texture packs.

I would say that since a texture pack is nothing more than JSON or XML file and a large png I could manually code a texture pack. How?

\$\endgroup\$
3
  • 2
    \$\begingroup\$ What would be the benefit of doing it manually? Or, maybe better phrased, what is the disadvantage of getting the tool to generate this for you? \$\endgroup\$ Commented Jun 12, 2015 at 8:25
  • 1
    \$\begingroup\$ Of course it's possible. Here's the source: github.com/libgdx/libgdx/tree/master/extensions/gdx-tools/src/… ; reverse engineer it to your heart's content. You probably won't find a step-by-step guide to do so, though. \$\endgroup\$ Commented Jun 12, 2015 at 20:01
  • \$\begingroup\$ @bornander The disadvantage is the $40 price tag. I need some of the features in the "pro version" but will not be able to afford until next month. I am always tight on money an this is an exceptionally bad month for me. I only started wanting to implements buttons after I finished my core game and now I need a menu, stats and other screens like that that will use a stage and ui toole. \$\endgroup\$ Commented Jun 13, 2015 at 18:39

1 Answer 1

2
\$\begingroup\$

I wouldn't recommend you creating texture atlas manually. With only two textures it looks like this:

atlas.png size: 1024,256 format: RGBA8888 filter: Linear,Linear repeat: none player rotate: false xy: 404, 4 size: 400, 174 orig: 400, 174 offset: 0, 0 index: -1 tank rotate: false xy: 2, 2 size: 400, 176 orig: 400, 176 offset: 0, 0 index: -1 

What is your problem with automatic atlas creating? You can either use TexturePacker GUI or run TexturePacker from code which is cool because you don't need manually edit anything after adding new texture.

\$\endgroup\$
3
  • \$\begingroup\$ My problem is the only TexturePacker I know of has a $40 price tag after a 7 day trial. I would like to mention that I am probably the cheapest person in the world. \$\endgroup\$ Commented Jun 13, 2015 at 18:35
  • 3
    \$\begingroup\$ No! Everything that comes with libGDX is completely free. This is how to use it from code github.com/libgdx/libgdx/wiki/Texture-packer . And this is GUI code.google.com/p/libgdx-texturepacker-gui . You probably went accidentally here codeandweb.com/store/texturepacker-single . \$\endgroup\$ Commented Jun 13, 2015 at 18:59
  • \$\begingroup\$ I'm glad to help you. \$\endgroup\$ Commented Jun 13, 2015 at 19:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.