[java] board game question in swing
Hello,
Im working on converting a multiplayer strategy game into java/swing. i have a large gif file containing about 100 individual spaces, that i want linked to individual "objects", and that i want selectable when you click on one. My idea to do this is to cut up the gif into a 100 little ones for each space, making a jbutton object with transparent parts for each space, and then using pixel grabber each time a jbutton was clicked to see if the space was clicked.
is there a better way to do this? any other ideas?
thanks,
jeff
Well that would work, but the pixelGrabber is v.slow and swing has its own issues! If it were me, i'd use an ImageIcon and store the coordinate and collision detection in the image/sprite object.
Edited by - bobbin on April 26, 2001 6:45:26 AM
Edited by - bobbin on April 26, 2001 6:45:26 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement