UI, a eas(y)ier way of making interfaces.

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Someguynamedpie
Citizen
Posts: 71
Joined: Wed Mar 31, 2010 10:59 pm

UI, a eas(y)ier way of making interfaces.

Post by Someguynamedpie »

:nyu: Yay! I made a ui thing! This makes it very easy to make interfaces.
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
Text on the button is centered. It uses the label element.
Elements finished so far...:
  • Button
  • Label
Work in Progress Elements
  • Input
  • Window
  • Checkbox
None of these elements use images.
I'm making a IRC client after I finish this lib to show the possibilities.
Anyone likey?
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: UI, a eas(y)ier way of making interfaces.

Post by Tesselode »

It's kind of hard to tell if it's any good if you haven't released, right? :P
User avatar
Chief
Party member
Posts: 101
Joined: Fri Mar 12, 2010 7:57 am
Location: Norway, 67° north

Re: UI, a eas(y)ier way of making interfaces.

Post by Chief »

I'm/I was used to GMOD lua too! Gief!
Homez
Prole
Posts: 1
Joined: Sat Jul 31, 2010 3:19 am

Re: UI, a eas(y)ier way of making interfaces.

Post by Homez »

It's just a matter of time before people start compiling a LOVE Derma. That would make my day. :awesome:

As for your button, looks good (based on the snippet). GMod did a lot of things right in the way of GUI, I'm just glad I don't have to mess with CL and SV side anymore.
User avatar
Someguynamedpie
Citizen
Posts: 71
Joined: Wed Mar 31, 2010 10:59 pm

Re: UI, a eas(y)ier way of making interfaces.

Post by Someguynamedpie »

I'll post a screen shot. Right now, the code is pretty messy, I'll clean it up, finish with a few elements and release a demo.
User avatar
ljdp
Party member
Posts: 209
Joined: Sat Jan 03, 2009 1:04 pm
Contact:

Re: UI, a eas(y)ier way of making interfaces.

Post by ljdp »

Actually, the gui library 'Goo' was based on Derma.
http://love2d.org/wiki/Goo
User avatar
Lap
Party member
Posts: 256
Joined: Fri Apr 30, 2010 3:46 pm

Re: UI, a eas(y)ier way of making interfaces.

Post by Lap »

ljdp wrote:Actually, the gui library 'Goo' was based on Derma.
http://love2d.org/wiki/Goo
No wonder I took to goo instantly.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests