rsnerd Posted May 25, 2015 Share 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 Quote Link to comment Share on other sites More sharing options...
FrostBug Posted May 25, 2015 Share 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 Quote Link to comment Share on other sites More sharing options...
rsnerd Posted May 25, 2015 Author Share Posted May 25, 2015 Ah it is gridx,y thanks! Quote Link to comment Share on other sites More sharing options...