简体   繁体   English

Android中的java.awt.Point类

[英]java.awt.Point class in Android

I would like to change java.awt.Point to some similar classes that can replace this. 我想将java.awt.Point更改为一些可以替换它的类似类。 This is a really hard problem for me, because Dalvik VM can't resolve AWT classes, but the given java algorithm uses it. 这对我来说是一个非常难的问题,因为Dalvik VM无法解析AWT类,但是给定的java算法使用它。 Exact error message: 确切的错误消息:

Point cannot be resolved to a type 点无法解析为某种类型

I have also tried to import classes from java.util without success. 我也尝试从java.util导入类,但没有成功。

Android does not support the AWT. Android不支持AWT。 Neither does it support Swing. 它也不支持Swing。
It has it's own graphics stuff. 它有自己的图形东西。

The class you can use instead is android.graphics.Point , when the coordinates are integers, or android.graphics.PointF , when the coordinates are of type float . 您可以使用的类是android.graphics.Point ,当坐标是整数时,或android.graphics.PointF ,当坐标是float类型时。

Having looked at libGDX after your commment on your question, it doesn't seem to have a 2D point class of it's own, instead using float x, float y where it needs 2D points. 在您的问题提交后查看了libGDX,它似乎没有自己的2D点类,而是使用float x, float y需要2D点。 As these are of type float , the PointF class is what you'll want to use. 由于这些是float类型,因此PointF类是您想要使用的类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM