cam.project(point.set(pos.x, pos.y, 0)); batch.begin(); font.draw(batch, "friction: " + playerPhysicsFixture.getFriction() + "\ngrounded: " + grounded, point.x + 20, point.y);
/** Transforms world-px coordinates to reference-screen pixel coordinates */ public static Vector2 worldPxToScreen (Vector2 worldPositionPx) { tmp3.set(worldPositionPx.x, worldPositionPx.y, 0); worldRenderer.camOrtho.project(tmp3, 0, 0, Config.Graphics.ReferenceScreenWidth, Config.Graphics.ReferenceScreenHeight); tmp2.set(tmp3.x, Config.Graphics.ReferenceScreenHeight - tmp3.y); return tmp2; }
public void worldToScreenCoords(Vector2 coords) { tmpV2.set(getX(), getY()); localToStageCoordinates(tmpV2); tmpV3.set(coords.x, coords.y, 0); camera.project(tmpV3, tmpV2.x, tmpV2.y, getWidth(), getHeight()); coords.set(tmpV3.x, tmpV3.y); stageToLocalCoordinates(coords); }