Example usage for com.badlogic.gdx.graphics Camera unproject

List of usage examples for com.badlogic.gdx.graphics Camera unproject

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics Camera unproject.

Prototype

public Vector3 unproject(Vector3 screenCoords) 

Source Link

Document

Function to translate a point given in screen coordinates to world space.

Usage

From source file:skyranger.game.userInterface.Cursor.java

License:Apache License

Vector2 unproject(Camera cam, Vector2 vector) {
    Vector3 tmp = new Vector3();
    tmp.set(vector.x, vector.y, 0f);/*from  w w w.j  a va  2  s .  co m*/
    cam.unproject(tmp);
    vector.set(tmp.x, tmp.y);
    return vector;
}