multiselect region can be drawn with the right mouse button
This commit is contained in:
@@ -6,6 +6,7 @@ Rect.__index = Rect
|
||||
function Rect:fromPoints(pt1, pt2)
|
||||
local o = { min = pt1, max = pt2 }
|
||||
setmetatable(o, self)
|
||||
return o
|
||||
end
|
||||
|
||||
function Rect:fromCoords(x1, y1, x2, y2)
|
||||
@@ -64,3 +65,11 @@ function Rect:overlapsRect(other)
|
||||
return self.min.x<other.max.x and self.min.x<other.max.x and
|
||||
self.min.y<other.max.y and self.min.y<other.max.y
|
||||
end
|
||||
|
||||
function Rect:draw(style)
|
||||
love.graphics.rectangle(style, self.min.x - Camera.pos.x, self.min.y - Camera.pos.y, self:width(), self:height())
|
||||
end
|
||||
|
||||
function Rect:__tostring()
|
||||
return "Rect["..tostring(self.min).." "..tostring(self.max).."]"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user