Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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  
  A little about GUI  (Read 2803 times)
0 Members and 1 Guest are viewing this topic.
Offline Sammyster

Senior Newbie


Medals: 1



« Posted 2012-05-05 22:21:47 »

Hello there!

Just a few questions from a noob again Smiley

How do you guys go about when you design your game UI?
Is there any special library you use for this?
Simply drawing out shapes/images?
Any usefull tip?

So tell me your story unless it's a secret.
Thanks Smiley
Offline Vladiedoo
« Reply #1 - Posted 2012-05-05 22:28:00 »

Hi, I'm a noob too but I'd like to try and help.

If your new to making video games (like I am) it can be more beneficial to finish a project first and then go back and make everything look nice and pretty. Basic shapes, gradients, images, etc can be quick to make and provide the player with a strong understanding of what's going on.

Sorry if that doesn't help much, I've asked a lot of questions on this forum but haven't been able to help back yet x). You might want to make your question a bit more specific though, it will help advanced users answer your question better.

-Good luck!
Offline davedes
« Reply #2 - Posted 2012-05-05 22:54:01 »

GUI for a Java2D game is not really a simple thing.

Your options:
1. Depend on Swing/AWT for GUI. Really ugly, slow, will probably lead to headache down the road, etc.

2. Write your own GUI system from the ground up (custom widgets, texture atlases, font rendering, etc). A lot of work, especially for a beginner, and especially if you "just need UI".

Really... Why are people still using Java2D for games? Huh Unless your game is based on software rendering, it's really the wrong library to be using. Use LibGDX, Slick2D, or straight LWJGL if you want to make a game in Java.

With that said: Most simple games just require the bare minimum: label, button, check box, radio button. This is all fairly easy to do, as each of these widgets is essentially just an extension of Label with some minor tweaks. The hard part will be efficient text rendering (you'll probably want your own bitmap font implementation, using the output of TWL Font Tool or Slick's Hiero).

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

Senior Newbie


Medals: 1



« Reply #3 - Posted 2012-05-05 22:55:33 »

Thanks Vladiedoo, all help is usefull help!

The way you mention here describes pretty well how I do it now. And it works i guess:)
So it's no magic involved? Tongue


Just asking how people go about on this part.

Offline ra4king

JGO Kernel


Medals: 356
Projects: 3
Exp: 5 years


I'm the King!


« Reply #4 - Posted 2012-05-05 23:06:26 »

Simply drawing out shapes/images?
Yup! Smiley

Offline Vladiedoo
« Reply #5 - Posted 2012-05-05 23:14:15 »

GUI for a Java2D game is not really a simple thing.

Your options:
1. Depend on Swing/AWT for GUI. Really ugly, slow, will probably lead to headache down the road, etc.

2. Write your own GUI system from the ground up (custom widgets, texture atlases, font rendering, etc). A lot of work, especially for a beginner, and especially if you "just need UI".

Really... Why are people still using Java2D for games? Huh Unless your game is based on software rendering, it's really the wrong library to be using. Use LibGDX, Slick2D, or straight LWJGL if you want to make a game in Java.

With that said: Most simple games just require the bare minimum: label, button, check box, radio button. This is all fairly easy to do, as each of these widgets is essentially just an extension of Label with some minor tweaks. The hard part will be efficient text rendering (you'll probably want your own bitmap font implementation, using the output of TWL Font Tool or Slick's Hiero).

About your question on why some people use Java2D: I'm new to Java game programming and was told from this forum that I should master Java2D and then move on to LigGDX/Slick2D and then LWJGL. However if programming straight into Slick2D/LigGDX or even LWJGL is a better choice, then I'll gladly move on x).
Offline Cero
« Reply #6 - Posted 2012-05-05 23:36:59 »

About your question on why some people use Java2D: I'm new to Java game programming and was told from this forum that I should master Java2D and then move on to LigGDX/Slick2D and then LWJGL. However if programming straight into Slick2D/LigGDX or even LWJGL is a better choice, then I'll gladly move on x).

Slick2D is easy. Libgdx requires knowledge you likely dont have when you're a beginner.
It comes with a price, since Libgdx is way more efficient. But we still use Slick, its all good.

We just write all GUI yourselfs. Its not really that hard, mostly you only need buttons anyway...

As soon as you leave Java2D you will use bitmap fonts. Really easy too with Slicks Tool.

Offline ReBirth
« Reply #7 - Posted 2012-05-06 06:13:35 »

Replacing ClickListener like in Swing, you let the GUI component like button to has reference into class that has right to execute.

Offline davedes
« Reply #8 - Posted 2012-05-06 06:18:58 »

About your question on why some people use Java2D: I'm new to Java game programming and was told from this forum that I should master Java2D and then move on to LigGDX/Slick2D and then LWJGL. However if programming straight into Slick2D/LigGDX or even LWJGL is a better choice, then I'll gladly move on x).
I started with Java2D, and it taught me very little about game development practices. IMO it would be much better to dive right into Slick/LibGDX/LWGJL, and frankly much easier (no need to worry about game loops, font rendering, etc).

Slick2D is not necessarily less efficient than LibGDX, depending on how it's used, but it is much more limited. It's a good place to begin if you have no OpenGL background, but if you want maximum flexibility, performance, memory management, distribution, etc. then LibGDX is definitely the way to go.

My two cents: Java2D is a horrible choice for games except for Java4K and a few other particular cases. Somebody feel free to prove me wrong...

Offline jonjava
« Reply #9 - Posted 2012-05-06 07:16:12 »

I think java2D is great! And so is Swing. Most games made with java could be made (and probably are) with java2D easily! The reason people tend to use other libs is because they wan't their games to run on many different platforms like android, not necessarily because they need the speed.

You should definitely know java2D and also Swing tbh. Swing works much like any other GUI API and will certainly be of use at some point.

Then again, the basics of both Java2D and Swing isn't rocket science per se. So moving onto "game" libraries like Slick2D shouldn't take too long.

But making games with java2D is perfectly fine, and in 9 times out of 10 if you can't do it in java2D you can't (or shouldn't be able to) do it in any other lib.

Imho:)

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline 65K
« Reply #10 - Posted 2012-05-06 07:50:28 »

I built everything outside the running game, mainly the lobby, with Swing.
The game itself only uses primitive do-it-yourself image based buttons and progress bars.
Doing a complete UI library is not trivial at all and usually too much effort for an one-man project.

For an intermediate in-game screen under Java2D I also set up Swing buttons, which is a bit tricky with active rendering, but it works.

About Java2D, I think it's a good starting choice for the overall beginner. Simple to use, fast and lets you concentrate on all the other gigantic tasks to solve. In my current game, only 4% of the overall code base is related to Java2d stuff, and another 5% to LibGdx. Rest is about infrastructure, AI, network, tiles, collisions, sound, etc., etc.

Offline R.D.

Senior Devvie


Medals: 2
Projects: 1


"For the last time, Hats ARE Awesome"


« Reply #11 - Posted 2012-05-06 09:35:40 »

I do all UI stuff by myself too. But that's mostly very simple and does just what I need. For my debugging I now use TWL which is just pure awesome sauce.

Oh and btw I think Java2D ist a bad start too... Dunno I even thing Slick2D is much easier to understand and also you more options you probatly want to have in a 2D game (rotation, zooming and float based positioning making subpixels a nice thing, and so on)
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.

Mr.CodeIt (24 views)
2014-12-23 03:34:11

rwatson462 (55 views)
2014-12-15 09:26:44

Mr.CodeIt (45 views)
2014-12-14 19:50:38

BurntPizza (89 views)
2014-12-09 22:41:13

BurntPizza (112 views)
2014-12-08 04:46:31

JscottyBieshaar (83 views)
2014-12-05 12:39:02

SHC (92 views)
2014-12-03 16:27:13

CopyableCougar4 (100 views)
2014-11-29 21:32:03

toopeicgaming1999 (160 views)
2014-11-26 15:22:04

toopeicgaming1999 (159 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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