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  
  Building UI Components  (Read 2070 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.


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

Senior Devvie

Medals: 11

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

Offline ClickerMonkey

JGO Coder

Medals: 26
Exp: 10 years

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


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

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:

Pages: [1]
  ignore  |  Print  

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

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

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

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

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

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

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

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

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

Solater (159 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!