BitmapFont in libGDX problem

Well I’m open minded to products using TWL - of course it can be good. But I thought the code was a horrible mess and hard to use compared with other alternatives.

Well the gui is incredible confusing.
Even the file dialog which looks nothing like a native one, everyone is used to.
It doesnt have many features and for that it seems very complicated.
Also, I have to choose a ttf… Not a big deal, but I do have all the font installed, so being able to just browse my fonts in hiero is much nicer. And doesnt seem to support .otf files and such

@Slick to Libgdx switch
We recently refractored and recoded our whole big ass game from Slick to Libgdx.
Mainly for the particle system but of course there is lot of other goodies aswell: fast deployment on android if necessary, SpriteBatches, Cameras, natives are within jars, box2d and more

There are some notes about the different tools here:
https://code.google.com/p/libgdx/wiki/Hiero
IMO the BMFont tool is the best (even though I wrote Hiero :p).

That seems odd, TWL has an extremely clean codebase. It is quite complicated but it is a complicated problem, especially when trying to solve it in such a completely configurable/themeable manner. Other toolkits like scene2d have less code but are less powerful. As far as ease of use, I’d agree there that TWL is hard to just pick up and get running.

I know, I know, but like you said its hard to get in Nifty looked easier still not appealing.
I just wrote my own… If you dont need as much functionality, these libs are just overkill - and most games dont have many complex gui elements…
scene2d is quite new IIRC or at least you guys have remade it recently or something, so I haven’t looked into it yet.

When I tried TWL I couldnt even get a button - well after hours of work.
I am very fond of “keeping things simple” - lets have all those complex interesting features optional, but a really simple easy to grasp codebase.
A simple button should be like 4 lines of code, similar to how AWT would do it:

  • new button (size, label-String, color)
  • call render method
  • check for click event
  • react to click event
    Thats it.

scene2d is a few years old. It saw a lot of work a few months ago but was more evolutionary, not a rewrite. I consider scene2d to be very stable. It has a pretty large user base and I’ve personally developed multiple complex app UIs with it (eg).

It is as simple as you describe when using TWL, with the addition of having to first create a theme that defines how the button looks/acts, and that is where it is easy to get bogged down.

Hello, I have the same problem as jhallenberg.
Whenever I draw some text, it appears as black, even though its color is white or anything I want with setColor() (I checked after changing with getColor()). I made the font with BMFont. Other than that the font works fine.

Well, I had some similar problems in the beginning. Changing the export option preset to “Outlined text with alpha” fixed it for me. These are my settings.
Width/Height: 256
Bitdepth: 8bit
Chnl A: outline
Font Descriptor: Text
Textures: PNG
Compression: Deflate

Actually, switching to GL10 has solved the problem, should have thought of that earlier really …

Not a lasting solution, though, is it?

I wish it wouldnt be, sadly the camera system only works with GL10, so I have no choice but to use it anyway

I know this is a bit of an old bump (so, sorry for the necro), but this is one of the first google results when trying to figure out this problem, and I have an answer.

Export the fnt file as 32bit if you’re using gl2.0.
I’m guessing the newer GL version uses the built in channels when changing the color, or something. With 8bit, only the alpha channel can be changed, but with 32bit it can change the color.