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  
  UI and Customizable Characters  (Read 682 times)
0 Members and 1 Guest are viewing this topic.
Offline JayTech

Jr. Member
**

Posts: 59
Medals: 1



« on: 2012-01-20 02:33:54 »

-First question, I recently stumbled on a way to create a custom JPanel(image) and custom JButtons(own images) and paint them to a JFrame which holds a  game board for painting 2dgraphics. Is this an ok way to have a UI the custom JPanel with my Custom Buttons on it?
-Second Question, what is the basic concept for character customization for sprites etc, like a basic image for a player and then being able to eqip armors and stuff, what is the logic etc behind doing so?

Thanks in advance =D.
Offline Fokusas

Jr. Member
**

Posts: 51
Medals: 2



« Reply #1 on: 2012-01-20 04:40:12 »

-First question, I recently stumbled on a way to create a custom JPanel(image) and custom JButtons(own images) and paint them to a JFrame which holds a  game board for painting 2dgraphics. Is this an ok way to have a UI the custom JPanel with my Custom Buttons on it?
Hello, your described way is called custom painting (overriding components pain or paintcomponent methods) and is common way to make GUI with image as background. You just need to make custom painting to component you want and then add that component to (in your way) JFrame and it will show it. Unless you set layout to null you shouldn't notice any weird behaviour.
Offline JayTech

Jr. Member
**

Posts: 59
Medals: 1



« Reply #2 on: 2012-01-20 12:40:18 »

What I mean is that, is this an acceptable way to make a UI, atm I pretty much I have  a frame which has a Panel which holds buttons which open up different menus"character screen, abilities, settings" instead of me drawing a rectangle I just used a JPanel on the bottom of the screen that Is static and whenever I add a game Panel eg board it gets painted with it.
Games published by our own members! Go get 'em!
Offline ra4king

JGO Kernel
*****

Posts: 3160
Medals: 196


I'm the King!


« Reply #3 on: 2012-01-21 01:20:13 »

That's quite fine for now since you're a beginner in games/graphics. Later on however, it is best to completely avoid Swing and make your own buttons.

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.101 seconds with 20 queries.