rsnerd Posted May 25, 2015 Posted May 25, 2015 (edited) For example i have a rock how do i get the screen position x and y of the rock where you interact with it or the center? is it getgrid x,y? Edited May 25, 2015 by rsnerd
FrostBug Posted May 25, 2015 Posted May 25, 2015 if you just want to interact with it, you should use a MouseDestination implementation with the rock, and grab a suitable point from that. if that's not what you're looking for; something like this should give you the center of the rocks bounding box Rectangle bounds = rock.getModel().getBoundingBox(rock.getGridX(), rock.getGridY(), rock.getZ()); Point center = bounds.getLocation(); center.translate((int)bounds.getWidth() / 2, (int)bounds.getHeight() / 2); 3