From b8dc9b6592a8e55051ae5f5c4d08fbe8421f5fe9 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Wed, 15 Sep 2010 11:28:06 +0200 Subject: [PATCH] Function rename --- camera.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/camera.lua b/camera.lua index f082a90..7bce4a6 100644 --- a/camera.lua +++ b/camera.lua @@ -36,18 +36,18 @@ function camera:draw(func) self:postdraw() end -function camera:toScreenCoords(p) +function camera:toCameraCoords(p) local w,h = love.graphics.getWidth(), love.graphics.getHeight() local p = p - self.pos return vector((p.x+w/2) * self.zoom, (p.y+h/2) / self.zoom):rotate_inplace(self.rot) end -function camera:toCameraCoords(p) +function camera:toWorldCoords(p) local w,h = love.graphics.getWidth(), love.graphics.getHeight() p = vector((p.x-w/2) / self.zoom, (p.y-h/2) / self.zoom):rotate_inplace(-self.rot) return p + self.pos end function camera:mousepos() - return self:toCameraCoords(vector(love.mouse.getPosition())) + return self:toWorldCoords(vector(love.mouse.getPosition())) end