mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Update button module
This commit is contained in:
11
load.lua
11
load.lua
@@ -14,11 +14,14 @@ BUTTON.setDefaultOption{
|
||||
draw = function(self)
|
||||
local need_big_font = (self.font == FONT_big)
|
||||
|
||||
love.graphics.setColor(0, 0, 0, 0.8)
|
||||
love.graphics.setColor(self.backgroundColor)
|
||||
love.graphics.rectangle('fill', self.x, self.y, self.w, self.h, self.r)
|
||||
|
||||
if self._hovering then
|
||||
love.graphics.setColor(0.4, 1, 1, 0.5)
|
||||
if self._pressed then
|
||||
love.graphics.setColor(self.pressColor)
|
||||
love.graphics.rectangle('fill', self.x, self.y, self.w, self.h, self.r)
|
||||
elseif self._hovering then
|
||||
love.graphics.setColor(self.hoverColor)
|
||||
love.graphics.rectangle('fill', self.x, self.y, self.w, self.h, self.r)
|
||||
end
|
||||
|
||||
@@ -48,6 +51,8 @@ BUTTON.setDefaultOption{
|
||||
love.graphics.setLineWidth(1)
|
||||
love.graphics.rectangle('line', self.x, self.y, self.w, self.h, self.r)
|
||||
end,
|
||||
backgroundColor = {0, 0, 0, 0.8},
|
||||
pressColor = {0.4, 1, 1, 0.5}
|
||||
}
|
||||
|
||||
-- Graphics
|
||||
|
||||
Reference in New Issue
Block a user