23 lines
685 B
Lua
23 lines
685 B
Lua
---@class Rectangle:Object Rectangle object
|
|
---@field x number horizontal position of Rectangle
|
|
---@field y number vertical position of Rectangle
|
|
---@field mode string drawing mode of Rectangle
|
|
---@field width number width of Rectangle
|
|
---@field height number height of Rectangle
|
|
local Rectangle = Object:extend()
|
|
|
|
function Rectangle:new(config)
|
|
self.x = config.x or 400
|
|
self.y = config.y or 300
|
|
self.mode = config.mode or "fill"
|
|
self.width = config.width or 100
|
|
self.height = config.height or 60
|
|
end
|
|
|
|
function Rectangle:update(dt) end
|
|
|
|
function Rectangle:draw()
|
|
love.graphics.rectangle(self.mode, self.x, self.y, self.width, self.height)
|
|
end
|
|
|
|
return Rectangle
|