Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Graphics 2d painting GUI HUD help  (Read 733 times)
0 Members and 1 Guest are viewing this topic.
Offline 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..

Offline 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.
Offline 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!
Offline 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.
Offline 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
Offline aazimon

Full Member
**

Posts: 208
Medals: 5



« Reply #5 on: 2012-01-12 16: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

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?
Offline 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.

Offline 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?
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.095 seconds with 20 queries.