By Components i mean, forms, scroll bars, textboxes… ect.
I’m making a game and debating on the best approach to handling this component.
I’m curious as to what the community recommends.
thanks
j.
By Components i mean, forms, scroll bars, textboxes… ect.
I’m making a game and debating on the best approach to handling this component.
I’m curious as to what the community recommends.
thanks
j.
Swing
I’ve used TWL extensively, but I don’t like it personally. Very finicky and has a steep learning curve.
I think he’s referring to making his own GUI system.
What are you using to make your game? Java2D, Slick2D, LWJGL, LibGDX?
Regardless of what you’re using for rendering, the idea behind a GUI component is the same. For my GUI system (built using LWJGL) I just took a look at Swing and how it’s organized (Containers, Components, etc etc) and came up with an idea of how I wanted my system to be structured. I’ve changed mine a bit since then to better fit my needs and be more generalized but that was the basis. So far I basically have everything be a component, then there are components like a Frame that you can add other components to. I also wrote a mouse/keyboard input system that feeds into the component system for click events and keyboard events. Once you’ve got a design in your head all you have to do is implement it. For drawing the components all you really have to do is draw some images. For example, I have a top level component that handles loading the GUI’s look from an image and then setting things up so that I can tile the different parts of the image to fit any sized component. Then any component that wants to have a GUI can extend the top level one. So a button is just a top level component with text and mouse handling added. Hope that gives you an idea of where to start.
Thanks Everyone!
My game is using LWJGL and JBullet right now.
I have a lot of my base framework and core mechanics working.
I am looking for how to build some minor forms to support the game.
(option screens, menu systems, chat windows )
I did debate about using swing / html and stylize it to look the game but i dont think i could do this and create as seemless an experience as im aiming for… ( i would have to switch out of opengl to show the panels… or use popups)
I very much appreciate the suggestions and input
thx
J.
Hi,
I’ve always found that building a GUI system in a game is one of the hardest things and something which is quite a time-sink.
Apart from TWL and swing that were already mentioned, there are other open-source GUI’s such as the one in libGDX and pulpcore. Pulpcore is a dead project but their GUI code is still available for use: https://code.google.com/p/pulpgui/
Cheers,
Keith