Java Game UI

Started by
6 comments, last by Stani R 16 years, 8 months ago
I'm working on creating a Java game, after experimenting with some generic java programs. So, naturally, I came here :) However, I can not seem to find out how to create a Game User Interface ( i.e. a menu system from which the player does actions). I am not looking for full blown code, more of a suggestion or snippet to help me. Thank you! (Sorry if this is the wrong forum, or if I sound incredibly dumb.)
Advertisement
The answer depends on the type of game you're trying to create and specifically on the technology you are going to use. Are you using JOGL or LWJGL? Then you'll need to roll your own GUI, or use something like FengGUI. Using jME? jME-BUI or FengGUI might help.
Quote:Original post by lightbringer
The answer depends on the type of game you're trying to create and specifically on the technology you are going to use. Are you using JOGL or LWJGL? Then you'll need to roll your own GUI, or use something like FengGUI. Using jME? jME-BUI or FengGUI might help.


Which library\renderer would you suggest? I'm looking to create something like [link=runescape.com]RuneScape[/link], except not MMO, and not so complex (yet :D)

(edit: Ouch, sorry for the double post. Clicked "Submit" twice :S)
Now that I think of it.. The main problem I'm having is I don't know how to create Graphical Buttons, i.e. I make a bitmap\image and use it as a button. Is that possible?
It's possible. What you do is you use that image to texture a quad. You'll need to write a lot of code to get it all running though, which is why I suggest that you try available solutions if possible and see if they fit your needs. RuneScape is a 3D game, so you'll need to have some kind of 3D solution. DirectX is pretty much out of the question on the Java platform right now, so you'll need to learn OpenGL. JOGL and LWJGL are the common OpenGL bindings used today. To speed up the process, you could go with an existing 3D engine. Check this thread for some suggestions. Then you have to see if your engine has some kind of UI library. If it doesn't, and if FengGUI is out of the question or not possible to integrate with the 3d engine, you'll have to write your own widget tree, do input and focus handling, and paint your own widgets to screen as a collection of quads. This topic of writing a GUI comes up pretty often, so do a forum search.
Thank you very much! You're very helpful :D
What i do, is that i have different classes for different types of windows. You should have a Window base class that is generic like x, y pos so you know the position of the window if you want people to drag it with the mouse. You can run a method that checks if your mouse pointer is hovered over the window, and its buttons. Use mousehandler, it can get pretty tricky, ive done this, but not the right way yet. I'm trying to make a way to easily add buttons and such on the windows myself. I dont want to use other libaries, because i like using my own code. The only libary i use is Slick2D, but i dont use the GUI extension for it.
DarkTech Software.
Quote:Original post by DarkMortar
I dont want to use other libaries, because i like using my own code.

I'd like to say that this is a bad strategy most of the time, because it is, and it goes against reinventing the wheel... but then I am totally guilty of this myself, especially as far as GUI is concerned ^_^;

This topic is closed to new replies.

Advertisement