TheScrub Posted August 28, 2013 Posted August 28, 2013 (edited) this is useful for a mouse destination it's so you don't have to do maths because some people are bad at math /* * @param minX this is the top left hand corner of the rectangle * @param minY this is the top left hand corner of the rectangle * @param maxX this is the bottom right hand corner of the rectangle * @param maxY this is the bottom right hand corner of the rectangle */ private Rectangle returnRectangle(int minX, int minY, int maxX, int maxY){ int height = maxY-minY; int width = maxX-minX; Rectangle r = new Rectangle(minX, minY, width, height); return r; } use: MouseDestination md = new RectangleDestination(returnRectangle(20,30,40,50)); this will do the math for the height and width..... so the width and height in this example would return: width:20 height:20 Edited August 29, 2013 by TheScrub
TheScrub Posted August 29, 2013 Author Posted August 29, 2013 You mean 20 and 20 whoops basic math error lol thanks for the pickup!