From 06f1812717986fb725cd4f094a9e7a1dbe3d1ad1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Sun, 9 Jul 2017 16:26:04 -0400 Subject: [PATCH] gamnit: `UICamera::camera_to_ui` returns a 3D point MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/gamnit/cameras.nit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gamnit/cameras.nit b/lib/gamnit/cameras.nit index 688082b..c83ace3 100644 --- a/lib/gamnit/cameras.nit +++ b/lib/gamnit/cameras.nit @@ -225,14 +225,14 @@ class UICamera end # Convert the position `x, y` on screen, to UI coordinates - fun camera_to_ui(x, y: Numeric): Point[Float] + fun camera_to_ui(x, y: Numeric): Point3d[Float] do # FIXME this kind of method should use something like a canvas # instead of being hard coded on the display. var wx = x.to_f * width / display.width.to_f - position.x var wy = y.to_f * height / display.height.to_f - position.y - return new Point[Float](wx, -wy) + return new Point3d[Float](wx, -wy, 0.0) end # Center of the screen, from the point of view of the camera, at z = 0 -- 1.7.9.5