multiselect region can be drawn with the right mouse button
This commit is contained in:
@@ -77,3 +77,16 @@ function Camera:positionAt(x,y)
|
||||
self.pos.y = math.floor((y/self.height)*self.height)
|
||||
end
|
||||
|
||||
-- translate screen coordinates to game coordinates
|
||||
function Camera:ptScreenToGame(pt)
|
||||
return self.pos + pt
|
||||
end
|
||||
|
||||
function Camera:mouseScreenPos()
|
||||
return Point:new(love.mouse.getX(),love.mouse.getY()) / game.scale
|
||||
end
|
||||
|
||||
-- return the mouse position as game coordinates
|
||||
function Camera:mouseGamePos()
|
||||
return self:ptScreenToGame(self:mouseScreenPos())
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user