Results 1 to 6 of 6
- 08-07-2011, 05:59 PM #1
Java Different Layers, Need Help For My Game Loaie.
My game is basicly just a giant grid. Wich reminds you of Dwarf Fortress adventure mode. The game will soon go into the Alpha 1.0 & be released. So I need some help to give the characters & mobs in the game a nice transparent background.
So as I said before. The game is basicly just a giant grid. On this grid you can walk around with your character. But in order to see what's behind the character & add mobs (Monsters & Animals) I will need to add a layer over this one.
The game is created with JPanels. Each one of those JPanels is holding a JLabel wich is holding an image.
What I want is another layer, over the first one. Wich is containing exactly the same things as the first layer, except of that the images will have a transparent background.
For an example of how I mean, visit Legends of Yore, and see how the bag works. It's basicly over the grid. Thanks!
Best Regards Alerhau
P.S. The help you guys have been giving me so far on all of my projects is awsome!
- 08-07-2011, 06:14 PM #2
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,236
- Rep Power
- 12
I don't know anything about those games, but if you want multiple layers then you can use a JLayeredPane.
See: How to Use Layered Panes (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
- 08-07-2011, 07:35 PM #3
Any more help?
-
Last edited by Fubarable; 08-07-2011 at 07:41 PM.
- 08-07-2011, 07:45 PM #5
I need a five row example. (That's all.) Sience I am not very good at understanding that kind of tutorial.
-
Sorry if this sounds harsh, but you will get better at understanding the tutorial and coding in general with practice and effort. You've nothing to lose to study it again and to try to apply it to your program; believe me it is effort well spent. If you then don't succeed, you'll at least be able to ask a specific answerable question, so it would help us help you too. Also, I've done something similar but with a chess program, and if you search the forum, you'll find this code in one of my answers.
Best of luck.
Similar Threads
-
Pass text to jTextArea class from another class(different layers)
By jeata in forum New To JavaReplies: 1Last Post: 08-02-2011, 02:34 PM -
Mouse listener does not work through application layers
By Warmonger in forum AWT / SwingReplies: 12Last Post: 06-07-2011, 11:56 PM -
Layers or composite?
By trishtren in forum Java 2DReplies: 1Last Post: 04-07-2011, 09:08 PM -
Mouse listening across layers
By dvreed77 in forum AWT / SwingReplies: 1Last Post: 02-17-2011, 04:42 PM -
questions about events in differents layers
By Jon_Xel in forum AWT / SwingReplies: 10Last Post: 07-13-2010, 06:37 AM
Bookmarks