Reputation: 300
In libgdx I set:
mCam = new OrthographicCamera(100, 100 * h / w);
// mCam.position.set(50, 50, 0);
mCam.position.set(24, 150, 0);
mCam.zoom = 0.5f;
mCam.update();
and print a body.x = 4, y = 153
and how to calculate the point into screen point
Upvotes: 1
Views: 246
Reputation: 19776
What you want should probably be Camera.project(...)
It should work this way:
Vector3 worldCoordinates = new Vector3(body.getPosition().x, body.getPosition().y, 0);
Vector3 screenCoordinates = mCam.project(worldCoordinates);
Upvotes: 1