我知道有这个方法:
pt.translate(int x, int y);
但是有没有这个方法:
pt.translate(Point anotherPoint);
相当于说:
pt.translate(anotherPoint.x, anotherPoint.y);
但我认为可能有这种方法,因为它更简单。
最佳答案
根据docs ,这是唯一的翻译方法。所以,正如您所说,
pt.translate(anotherPoint.x, anotherPoint.y);
是你要找的。p>
另外,访问一个对象的字段就像它得到的一样简单:-)
关于Java 翻译点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22888970/