May 25, 201510 yr 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, 201510 yr by rsnerd
May 25, 201510 yr 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);
Create an account or sign in to comment