Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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  
  Graphics 2d painting GUI HUD help  (Read 2904 times)
0 Members and 1 Guest are viewing this topic.
Offline JayTech

Junior Devvie


Medals: 1



« Posted 2012-01-12 06:40:30 »

Hey JGO,
My first post, I hear this is the place to go for great advice and help!
Ok, so I'm developing a game currently(newb 2d game developer/game dev(non newb programmer I think)) and I decided I wanted an animated game instead of text and static images. So I looked into graphics 2d and got some animations going onto a game board. How do I go about adding a static GUI hud to that board to the game(RPG), what is the best way to add a GUI hud to a 2d game(User Panel buttons options health bar etc) .Any help is appreciated.

Still a bit confused with Graphics 2d though, most of my code is written for Characters(save file) combat, monster creation, just need to get over this hurdle, really all help is appreciated my head is kind of spinning experimenting with this..

Offline aazimon
« Reply #1 - Posted 2012-01-12 17:30:34 »

Usually, the components in a game are built similar to the sprites, instead of using swing components. You would have them be drawn last, so they will be on-top of everything else.
Offline JayTech

Junior Devvie


Medals: 1



« Reply #2 - Posted 2012-01-12 18:25:36 »

So you're saying I have to build components from scratch and if a mouse click in x area of painted object is present do x command, do action listeners still work? Or is there another way of doing so i'm open to all Ideas, thanks.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline aazimon
« Reply #3 - Posted 2012-01-12 20:47:35 »

The idea of doing the component as a graphic element is to better integrate it into the environments. You can use Swing components if you find it easier.
The graphic component will need to implement some type of action listener. Are you listening for mouse events currently in your game? If so, on a mouse click, have the graphic component listen for the click, then it will check if the click occurred inside the component. Then the component will fire off an action as you would the swing component.
Offline JayTech

Junior Devvie


Medals: 1



« Reply #4 - Posted 2012-01-12 20:58:15 »

So what would be the first step to creating a component, like pretty much I want a diablo like looking GUI on the bottom of the game board, ability slots and such. I have an artist that can do the art for me but i've never worked with creating custom components, the plan was to paint a custom shelled JButton onto a painted HuD. I'm realy inexperienced with this matter and with graphics 2d.

Thanks,
Jay
Offline aazimon
« Reply #5 - Posted 2012-01-12 21:15:04 »

What I have done, was I extends my sprite class (same class I used for characters on the screen), and added functionality to that (ComponentSprite). This has been discussed in the forum here http://www.java-gaming.org/topics/game-select-interface/21034/view.html
Offline JayTech

Junior Devvie


Medals: 1



« Reply #6 - Posted 2012-01-12 21:22:30 »

Interesting..also, would a  glass pane work at all or no?
Offline GabrielBailey74
« Reply #7 - Posted 2012-01-12 21:26:45 »

I could give you my 2D RPG (sprites,animation,maps,movement) files, there's 3 of them.
Easily do what you're asking.
IDK if 'spoonfeeding' is allowed here, but i'd be happy to give you my code to learn.

Offline JayTech

Junior Devvie


Medals: 1



« Reply #8 - Posted 2012-01-12 21:31:59 »

 Would be a great learning experience, highly appreciate if you would share that with me, can you post or email?
Pages: [1]
  ignore  |  Print  
 
 

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

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

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

Solater (62 views)
2018-03-17 05:04:08

nelsongames (109 views)
2018-03-05 17:56:34

Gornova (159 views)
2018-03-02 22:15:33

buddyBro (703 views)
2018-02-28 16:59:18

buddyBro (92 views)
2018-02-28 16:45:17

xxMrPHDxx (493 views)
2017-12-31 17:17:51

xxMrPHDxx (733 views)
2017-12-31 17:15:51
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
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!