Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (624)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
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 943 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: 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 Kernel

Medals: 147
Projects: 3
Exp: 4 years

when she says go deeper but you ran out of poems

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

    Check out my website!  |   Use the Mercury game library!   |  Follow me on Twitter!      |          |

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

KaiHH (15 views)
2015-10-11 14:10:14

KaiHH (15 views)
2015-10-11 13:26:18

BurntPizza (43 views)
2015-10-08 03:11:46

BurntPizza (21 views)
2015-10-08 00:30:40

BurntPizza (26 views)
2015-10-07 17:15:53

BurntPizza (42 views)
2015-10-07 02:11:23

KaiHH (47 views)
2015-10-06 20:22:20

KaiHH (21 views)
2015-10-06 19:41:59

BurntPizza (38 views)
2015-10-06 19:04:48

basil_ (52 views)
2015-09-30 17:04:40
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 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!