summaryrefslogtreecommitdiff
path: root/camera.lua
diff options
context:
space:
mode:
Diffstat (limited to 'camera.lua')
-rw-r--r--camera.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/camera.lua b/camera.lua
index 19c5bd4..b93b7c1 100644
--- a/camera.lua
+++ b/camera.lua
@@ -34,6 +34,9 @@ function Camera.world_to_screen(self,pos)
local so = screen_offset()
return (pos-self.pos) * self.zoom + so
end
+function Camera.mouse_world(self)
+ return self:screen_to_world(Pos(love.mouse.getPosition()))
+end
function Camera.extents(self)
local W,H = love.graphics.getDimensions()