Tainted gui

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Tainted gui

Post by appleide »

I know, I know, there are half a dozen gui thingys already made for love. But you see, this new one is made before all of them! It was made for a different lua game engine; I just ported it. :)

It's still in development, see comments in source for documentation. Hope you can improve it so I can steal back your changes! ;) (same license as LOVE)

This gui's "ace" is you can have widgets all over each other and it would still work perfectly as expected by a human user. (or is supposed to!) see demo.

The textfield is a bit iffy though; set_key_repeat is not in love and I haven't done it by myself either; and I have only done some of the shifting of keys and capslock isn't done yet. (dunno why love doesnt do this auto...)
I was also lazy and relied on setscissor too much (rather than just calling less draw commands) for the textfield so it slows the computer down as strings get longer. love havent implemented scrap so cannot copy and paste either :<

p.s Where's that lua game engine, you ask? Well I was working on it by myself before I knew about love half a year ago. but when I stumbled upon love I realised alot of the work has already been done, i'd only need to compile love for mac os x, so I jumped ship!

(I only ported this because I want to use something soon and I can't find downloads of any other guis with textfields implemented...)
Attachments
screenshot.png
screenshot.png (17.1 KiB) Viewed 9727 times
Tainted.zip
demo+source w/comments - documentation
(22.86 KiB) Downloaded 306 times
User avatar
TsT
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France
Contact:

Re: Tainted gui

Post by TsT »

Good work!

But...
- Can you please release your work under free licence like GPL or zlib ? (you can read this post)
- Why do you start/end your lua file by "do"/"end" is it really usefull ?

Best Regards,
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Tainted gui

Post by qubodup »

Game could not be loaded.

This is when I love the extracted Tainted/

Also: Does OSX not have case-sensitivity? main.lua says Stars.lua but the file is stars.lua.
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

Re: Tainted gui

Post by Kuromeku »

Finally. Something I can work with.

Thank you! <3
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: Tainted gui

Post by appleide »

:)
TsT wrote:Good work!

But...
- Can you please release your work under free licence like GPL or zlib ? (you can read this post)
- Why do you start/end your lua file by "do"/"end" is it really usefull ?

Best Regards,
It's still in development, see comments in source for documentation. Hope you can improve it so I can steal back your changes! (same license as LOVE)
:)
by using do/end I can keep variables local and not fill the global namespace too much. local variables are also faster to access.

@qubodup: Sorry I changed file names at the last second and got careless; Yes, mac os x disks aren't case sensitive
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: Tainted gui

Post by appleide »

I'd like a better name than "tainted"... Suggestions please!

I've fixed a bug with the textfield, and made it not slow down when there are more text inside.

Probably will do a multiline text view to display text but I will not make it editable, yet.

Will add scrollbars.

There are some more easy stuff I might do too. checkboxes, radio buttons, popup menus. Just need good images for these. (and probably new one for buttons.)

I might add a table view too.
:)

I'll go on a plane tomorrow so will be away for some days though.
Attachments
Tainted.zip
(23.41 KiB) Downloaded 203 times
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Tainted gui

Post by qubodup »

appleide wrote:I'd like a better name than "tainted"... Suggestions please!
BFF (Buttons, Fields & Fun)

Um, will you fix the case thing? Or is the demo not *supposed* do run? :?

PS: Oh, I didn't see the attachment and didn't try it yet. Whops.

Please use version number btw.
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: Tainted gui

Post by appleide »

@qubodup: can you download this and see if it runs?
I've reverted to my previous method of offsetting text field. It has much cleaner code.
Implemented standard setters and getters. reference:

Code: Select all

Reference
All Widgets:
	public variables:
		note: These functions are run when triggered
		mousepressed, of type: function(self, x,  y, button)
		mousereleased, of type: function(self, x, y, button)
		keypressed, of type: function(self, key)
	methods:
		getx()
		setx(number)
		
		gety()
		sety(number)
		
		getwidth()
		setwidth(number)
		
		getheight()
		setheight(number)
		
		getvisible()
		setvisible(boolean)
		
		getfont()
		setfont(font)
		
		gettextcolor()
		settextcolor(color)
		
		getvalue()
		setvalue(generic)
		
		getfocused()
		
		getenabled()
		
		setstyle(string)
			example: button.applyStyle("x:200;y:50;width:300;visible:false")
				note: works only if value is number, boolean or string that isn't either of those
Context:
	methods:
		Button(id, x, y, label)
			creates button
		Context(id, x, y, w, h)
			creates sub-context; 0 means infinite for w and h
		TextField(id, x, y)
			creates textfield
		getElementById(string)
			gets widget in context by id
		byId(string)
			same as getElementById
		out(string)
			outputs text onto screen
		focused(widget)
			checks if widget is focused

Attachments
Tainted(02122008).zip
(24.75 KiB) Downloaded 222 times
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Tainted gui

Post by qubodup »

appleide wrote:@qubodup: can you download this and see if it runs?
Pardon the delay, for only now I 'ave a LOVE binary compiled.

It runs. Is it supposed to look like following image?
TAINTED LOVE
TAINTED LOVE
taint.png (12.97 KiB) Viewed 9427 times
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: Tainted gui

Post by appleide »

umm.... if your monitor is black and white, that is... :/ can you look inside the .love to see if the images are blue? I think the images are not loaded,...
Post Reply

Who is online

Users browsing this forum: No registered users and 205 guests