added transparency thing I was supposed to do a week ago

This commit is contained in:
Josh
2018-06-06 14:08:34 -05:00
parent 1ea788fb43
commit c5572a0078
3 changed files with 6 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
love.filesystem.setRequirePath(love.filesystem.getRequirePath() .. ";JUI/?.lua")
return {
JUIScene = require("lib.classes.JUIScene"),
Frame = require("lib.classes.Frame"),

View File

@@ -6,6 +6,8 @@ local UIButton = UIRect:subclass("UIButton")
function UIButton:init()
self.super:init()
self.mouseDown = true
self.buttonActivationAnimation = ""
self.buttonDeactivationAnimation = ""
self.mouseClickDown = Event:new()
self.mouseClickUp = Event:new()

View File

@@ -206,12 +206,12 @@ function UIRect:render()
local size = self:getAbsoluteSize()
love.graphics.setColor(self.backgroundColor:out())
love.graphics.setColor(self.backgroundColor:out(), self.backgroundTransparency)
-- background
love.graphics.rectangle("fill", pos.x, pos.y, size.x, size.y, self.cornerRounding, self.cornerRounding, 25)
love.graphics.setColor(self.borderColor:out())
love.graphics.setLineWidth(self.borderWidth)
love.graphics.setLineWidth(self.borderWidth, self.borderTransparency)
-- border
love.graphics.rectangle("line", pos.x-(self.borderWidth/2), pos.y-(self.borderWidth/2), size.x+self.borderWidth, size.y+self.borderWidth, self.cornerRounding, self.cornerRounding)
end