Page 1 of 1
Tainted gui
Posted: Mon Nov 24, 2008 4:16 pm
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...)
Re: Tainted gui
Posted: Mon Nov 24, 2008 5:35 pm
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,
Re: Tainted gui
Posted: Mon Nov 24, 2008 6:06 pm
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.
Re: Tainted gui
Posted: Mon Nov 24, 2008 7:01 pm
by Kuromeku
Finally. Something I can work with.
Thank you! <3
Re: Tainted gui
Posted: Tue Nov 25, 2008 12:00 am
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
Re: Tainted gui
Posted: Tue Nov 25, 2008 6:33 am
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.
Re: Tainted gui
Posted: Tue Nov 25, 2008 1:12 pm
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.
Re: Tainted gui
Posted: Mon Dec 01, 2008 4:12 pm
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
Re: Tainted gui
Posted: Fri Dec 05, 2008 5:53 am
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
- taint.png (12.97 KiB) Viewed 10552 times
Re: Tainted gui
Posted: Wed Dec 10, 2008 12:22 pm
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,...