core/menusystem: place the cursor drawing script in a separate file
This commit is contained in:
parent
b3febf0fb3
commit
434b5e6865
2 changed files with 34 additions and 29 deletions
|
@ -106,35 +106,6 @@ function BaseWidget:destroy()
|
|||
self.destroyed = true
|
||||
end
|
||||
|
||||
function drawWidget_selected(x, y, w, h)
|
||||
love.graphics.setColor(0,0,0)
|
||||
love.graphics.rectangle("fill", x, y, 4, 8)
|
||||
love.graphics.rectangle("fill", x, y, 8, 4)
|
||||
|
||||
love.graphics.rectangle("fill", x + w, y, -4, 8)
|
||||
love.graphics.rectangle("fill", x + w, y, -8, 4)
|
||||
|
||||
love.graphics.rectangle("fill", x, y + h, 4, -8)
|
||||
love.graphics.rectangle("fill", x, y + h, 8, -4)
|
||||
|
||||
love.graphics.rectangle("fill", x + w, y + h, -4, -8)
|
||||
love.graphics.rectangle("fill", x + w, y + h, -8, -4)
|
||||
|
||||
love.graphics.setColor(255,255,255)
|
||||
love.graphics.rectangle("fill", x + 1, y + 1, 2, 6)
|
||||
love.graphics.rectangle("fill", x + 1, y + 1, 6, 2)
|
||||
|
||||
love.graphics.rectangle("fill", x + w - 1, y + 1, -2, 6)
|
||||
love.graphics.rectangle("fill", x + w - 1, y + 1, -6, 2)
|
||||
|
||||
love.graphics.rectangle("fill", x + 1, y + h - 1, 2, -6)
|
||||
love.graphics.rectangle("fill", x + 1, y + h - 1, 6, -2)
|
||||
|
||||
love.graphics.rectangle("fill", x + w - 1, y + h - 1, -2, -6)
|
||||
love.graphics.rectangle("fill", x + w - 1, y + h - 1, -6, -2)
|
||||
|
||||
end
|
||||
|
||||
Widget.Base = BaseWidget
|
||||
|
||||
return Widget
|
||||
|
|
34
sonic-boost.love/core/modules/menusystem/widgets/utils.lua
Normal file
34
sonic-boost.love/core/modules/menusystem/widgets/utils.lua
Normal file
|
@ -0,0 +1,34 @@
|
|||
local menuUtils = {}
|
||||
|
||||
function menuUtils.drawCursor(x, y, w, h)
|
||||
love.graphics.setColor(0,0,0)
|
||||
|
||||
love.graphics.rectangle("fill", x, y, 4, 8)
|
||||
love.graphics.rectangle("fill", x, y, 8, 4)
|
||||
|
||||
love.graphics.rectangle("fill", x + w, y, -4, 8)
|
||||
love.graphics.rectangle("fill", x + w, y, -8, 4)
|
||||
|
||||
love.graphics.rectangle("fill", x, y + h, 4, -8)
|
||||
love.graphics.rectangle("fill", x, y + h, 8, -4)
|
||||
|
||||
love.graphics.rectangle("fill", x + w, y + h, -4, -8)
|
||||
love.graphics.rectangle("fill", x + w, y + h, -8, -4)
|
||||
|
||||
love.graphics.setColor(255,255,255)
|
||||
|
||||
love.graphics.rectangle("fill", x + 1, y + 1, 2, 6)
|
||||
love.graphics.rectangle("fill", x + 1, y + 1, 6, 2)
|
||||
|
||||
love.graphics.rectangle("fill", x + w - 1, y + 1, -2, 6)
|
||||
love.graphics.rectangle("fill", x + w - 1, y + 1, -6, 2)
|
||||
|
||||
love.graphics.rectangle("fill", x + 1, y + h - 1, 2, -6)
|
||||
love.graphics.rectangle("fill", x + 1, y + h - 1, 6, -2)
|
||||
|
||||
love.graphics.rectangle("fill", x + w - 1, y + h - 1, -2, -6)
|
||||
love.graphics.rectangle("fill", x + w - 1, y + h - 1, -6, -2)
|
||||
|
||||
end
|
||||
|
||||
return menuUtils
|
Loading…
Reference in a new issue