mr_meat/meat_tables.lua

26 lines
No EOL
696 B
Lua

MeatTable = {}
MeatTable.__index = MeatTable
function MeatTable:new()
local instance = setmetatable({}, MeatTable)
instance.image = love.graphics.newImage("assets/images/env/newer_table.png")
instance.x = (love.graphics.getWidth() - instance.image:getWidth()) / 2;
instance.y = (love.graphics.getHeight() - instance.image:getHeight()) / 2;
return instance
end
function MeatTable:draw()
local x = self.x
local image = self.image
local y = self.y
love.graphics.draw(image, x, y);
end
function MeatTable:isHovering(x, y)
return x >= self.x and x <= self.x + self.image:getWidth() and y >= self.y and y <= self.y + self.image:getHeight()
end
return MeatTable