I am having a dilemma right now. I am making a GUI system for my game, and all GUI need some kind of text. Some things might be able to have a static text, but others need dynamic text. So, I just use libGdx's built-in BitmapFont. My problem now is that I want to use only one Pixmap for all of my GUI components/widgets. So I got rid of my widgets draw function, because they don't need to update every second. But now the BitmapFont won't work, because I don't know how to draw text to them. I see two options right now:

1. Bring back the draw function.2. Make my own texture holding the alphabet and make my own renderer.

I'm leaning toward option 2, but if there is a better way, I would rather not draw 26 characters (All caps). What do you suggest I do?

Are you drawing pixmaps to screen? why? I bet you have understand something horrible wrong. Pixmaps are used to provide data for textures, they are horrible slow for rendering stuff to screen per frame basis.

Just draw textureRegions/textures and top of that draw bitmap font. Simple and effective.

You can't actually draw them directly to the screen, you have to make it into a texture first. I just make the Pixmap into a texture whenever I need to update the GUI. After editing the Pixmap first.

...But I guess you're right. That means I have to make graphics for all the widget that need it... Which wouldn't be that difficult. Now that I think of it, why dif I even use Pixmaps in the first place? Ah well. To work.

After a long time of searching, I found two things. I found that libGdx does indeed have a GUI built-in and also has a TWL extension. It may be because I am tired, but I am having trouble understanding how to use them. I looked for tutorials of either one, but there isn't any. If I can't find a tutorial, I will just continue with making my own GUI system. And, it might not be that bad.

LibGDX's UI classes are pretty compact -- you should be able to skim them easily to get an idea of how they work. Learning to use these libraries would probably be wiser than trying to recreate their functionality from scratch, which becomes a lot of work when you consider clipping, input, complex widgets, etc.

From what I understand, in the latest version of libGDX the TWL style interface is no longer being supported. Unless I'm completely wrong, and just failed in using it when I was messing around with it.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org