Java graphic objects as in flashgames
Posted
by
Ryu Kajiya
on Game Development
See other posts from Game Development
or by Ryu Kajiya
Published on 2011-03-06T20:23:25Z
Indexed on
2011/03/07
0:18 UTC
Read the original article
Hit count: 193
java
How is it possible (with the standard Java2D engine) to use small sprites like graphic objects?
For those who don't know what I mean, in all those Flash-games like on Facebook they put small sprites on the screen which react to mouse-over and clicks. I tried to do the same in Java but can't find a good method. Swing components always spread over the whole bitmap, but I only want to get a reaction from the object when the mouse is over a pixel that's not transparent.
So basically checking every time if the object below the mouse contains a non-transparent pixel (which i believe could be pretty intense in a gameloop or repaint loop). I have no idea how to implement such a thing efficiently.
© Game Development or respective owner