JayTech
Jr. Member   Posts: 59 Medals: 1
|
 |
«
on:
2012-01-12 01: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..
|
|
|
|
|
aazimon
Full Member   Posts: 208 Medals: 5
|
 |
«
Reply #1 on:
2012-01-12 12: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.
|
|
|
|
|
JayTech
Jr. Member   Posts: 59 Medals: 1
|
 |
«
Reply #2 on:
2012-01-12 13: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! Go get 'em!
|
|
aazimon
Full Member   Posts: 208 Medals: 5
|
 |
«
Reply #3 on:
2012-01-12 15: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.
|
|
|
|
|
JayTech
Jr. Member   Posts: 59 Medals: 1
|
 |
«
Reply #4 on:
2012-01-12 15: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
|
|
|
|
|
|
|
JayTech
Jr. Member   Posts: 59 Medals: 1
|
 |
«
Reply #6 on:
2012-01-12 16:22:30 » |
|
Interesting..also, would a glass pane work at all or no?
|
|
|
|
|
GabrielBailey74
Full Member   Posts: 157 Medals: 2
Owner of Elite Demons R.I.P
|
 |
«
Reply #7 on:
2012-01-12 16: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.
|
|
|
|
JayTech
Jr. Member   Posts: 59 Medals: 1
|
 |
«
Reply #8 on:
2012-01-12 16:31:59 » |
|
Would be a great learning experience, highly appreciate if you would share that with me, can you post or email?
|
|
|
|
|
|