Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Best way to make a game UI?  (Read 1948 times)
0 Members and 1 Guest are viewing this topic.
Offline mernen

Junior Newbie

« Posted 2007-05-16 04:10:14 »

Hello there,

First of all, I have very little experience with graphical interfaces in Java, both in the "traditional" GUIs (Swing, SWT, etc) and in game development.

I was wondering what would be the best way to make the UI for a game. Particularly, chat: online games often offer a text field for chatting, and I'd like to know good ways to make one. The first obvious approach is writing your own editbox, but there are so many problems to deal with (cursor position and selection, cut/paste, keyboard shortcuts, input methods and other localization stuff, Unicode combining characters) I hope there are better ways.
I never really enjoyed Swing for its not-very-convincing pseudo-native look (and come on, Metal is awful), but as I've heard it's possible to custom-draw its controls, they could be really handy for games. Is it possible to blend them with good performance graphics? Or are there better methods?

PS: sorry if this was already answered. I couldn't find anything in my (rather poor) searches.
Offline Eliwood

Junior Devvie


« Reply #1 - Posted 2007-05-16 05:53:15 »

There are pre-written solutions that already do what you need. Here are a few of them, though only the first one will work right out of the box for you. The others are addons for particular libraries and use those libraries to perform drawing.

Feng GUI - I can't seem to find the thread for this, but if you search for this around here, you'll surely find it. It's the farthest along of the 3 mentioned here.

SUI - UI library for Slick. This one's well-written and maintained, but it's an addon for Slick, so if you use it, you'll need to bind it to whatever drawing routines you use.

GTGE GUI. Same deal as SUI. It's well-implemented (though not finished), but it's tied in to GTGE. However, GTGE just uses Graphics2D, so you may be able to use it with little modification. Watch the license though on this one.

- Jon

Offline CommanderKeith
« Reply #2 - Posted 2007-05-16 08:01:55 »

Those libraries all sound good but FengGUI and Slick (as far as I know) are tied to openGL bindings and not Java2D (Graphics2D).  You can use Swing in your games, just be aware of threading issues.  Swing is handy since you can easily bundle a new look-and-feel by adding an extra jar file to the classpath and adding one line of code.

The only thing you have to be aware of are the threading issues.  Swing's Event Dispatch Thread is a big worry since you can not paint or modify it outside of the EDT.


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mernen

Junior Newbie

« Reply #3 - Posted 2007-05-16 18:53:27 »

Thanks for the replies!

I've checked them, and while FengGUI doesn't seem to offer modal dialogs, it appears to be by far the most complete. I'm missing international character support (actually all the three suggested do), but I guess I can help improve the library and implement something Smiley
Pages: [1]
  ignore  |  Print  

EgonOlsen (42 views)
2018-06-10 19:43:48

EgonOlsen (22 views)
2018-06-10 19:43:44

EgonOlsen (43 views)
2018-06-10 19:43:20

DesertCoockie (198 views)
2018-05-13 18:23:11

nelsongames (124 views)
2018-04-24 18:15:36

nelsongames (123 views)
2018-04-24 18:14:32

ivj94 (864 views)
2018-03-24 14:47:39

ivj94 (125 views)
2018-03-24 14:46:31

ivj94 (768 views)
2018-03-24 14:43:53

Solater (140 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!