Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
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 1175 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 Member




Stencyl


« 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.
http://slick.javaunlimited.net/viewtopic.php?t=187

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.
http://www.goldenstudios.or.id/products/utilities/gui/index.php

- 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.

Keith

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  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (12 views)
2014-08-28 18:26:30

CopyableCougar4 (24 views)
2014-08-22 19:31:30

atombrot (37 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (29 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (28 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (33 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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
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!