Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (575)
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  
  Building UI Components  (Read 628 times)
0 Members and 1 Guest are viewing this topic.
Offline jmguillemette
« Posted 2013-09-04 17:23:52 »

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.

-=Like a post.. give the author a medal!=-
Offline Several Kilo-Bytes

Senior Duke


Medals: 11



« Reply #1 - Posted 2013-09-04 17:31:42 »

Swing
Offline ClickerMonkey

JGO Coder


Medals: 20


Game Engineer


« Reply #2 - Posted 2013-09-04 17:35:50 »

I've used TWL extensively, but I don't like it personally. Very finicky and has a steep learning curve.

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

JGO Wizard


Medals: 87
Projects: 4
Exp: 3 years


Extreme Typist.


« Reply #3 - Posted 2013-09-04 17:42:33 »

I think he's referring to making his own GUI system.

What are you using to make your game? Java2D, Slick2D, LWJGL, LibGDX?

Offline Z-Man
« Reply #4 - Posted 2013-09-04 19:45:34 »

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.
Offline jmguillemette
« Reply #5 - Posted 2013-09-04 22:09:15 »

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 Smiley

thx
J.

-=Like a post.. give the author a medal!=-
Offline CommanderKeith
« Reply #6 - Posted 2013-09-05 00:38:53 »

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

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.

Longarmx (34 views)
2014-10-17 03:59:02

Norakomi (25 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (26 views)
2014-10-15 16:18:58

TehJavaDev (50 views)
2014-10-14 00:39:48

TehJavaDev (50 views)
2014-10-14 00:35:47

TehJavaDev (40 views)
2014-10-14 00:32:37

BurntPizza (63 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (74 views)
2014-10-11 22:30:10
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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!