I was so used to gmod, I just couldnt get used to the other User interfaces out there. So, I made UI. (unique name amirite)
Here is a inefficient example:
Code: Select all
local test=0
local tst=0
require("ui/ui.lua")
local btn=ui:Create("button")
btn:SetPos(0,100)
btn:SetSize(100,20)
btn:SetColor(Color(255,0,0,255))
btn:SetTextColor(Color(0,0,0))
btn:SetBorderColor(Color(0,255,0))
btn:SetBorderEnabled(true)
function btn.OnMouseOver()
test=1
end
function btn.OnMouseOut()
test=0
end
function btn.OnMouseDown(k)
tst=k=="l" and 1
end
function btn.OnMouseUp()
tst=0
end
function love.draw()
ui.draw()
btn:SetColor(Color(255*tst,255*test,100,255))
btn:SetBorderColor(Color(255*tst,255,0))
btn:SetText(string.rep("|",math.abs(math.cos(os.clock()*2)*10)))
btn:SetPos(math.sin(os.clock()*2)*100+100,math.cos(os.clock()*2)*100+100)
end
Elements finished so far...:
- Button
- Label
- Input
- Window
- Checkbox
I'm making a IRC client after I finish this lib to show the possibilities.
Anyone likey?