libgdx坐标转换


libgdx坐标转换

GestureDetector.GestureListener


    @Override
    public boolean touchDown(float x, float y, int point, int button) {

        Vector3 vector3 = new Vector3(x, y, 0);
        getStage().getCamera().unproject(vector3); // 坐标转化
        particlePool.start(KEY_POINT, vector3.x, vector3.y);
        LogUtil.v(TAG, "touchDown ", x, y,vector3.x,vector3.y);
        return false;
    }



actor在整个屏幕中的绝对坐标

            Vector2 leftBottom = actor.localToStageCoordinates(new Vector2(0, 0));
            Vector2 rightTop = actor.localToStageCoordinates(new Vector2(actor.getWidth(),actor.getHeight()));


你可能感兴趣的:(libgdx坐标转换)