LoveUI for Love 0.5.0

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

Re: LoveUI... has button, Textfield, scrollVIew

Post by appleide »

1 mark for getting part a) correct. XD

For the second textfield its not a bug, more a limitation. Otherwise when you edit it, it'd have like "Textfield: Balia", where the last 'a' is the newly entried letter. And since it we've bounded it to the first textfield, which has 'Bali', it'd turn into 'Textfield:Balia'. Which in turn, will cause the second textbox to have "Textfield: Textfield: Balia". This will occur with every letter we press, which isn't at all desirable. So I made it a one-way binding, it's always bounded to what ever value is in the top textfield, resulting it being uneditable as a side-effect.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: LoveUI... has button, Textfield, scrollVIew

Post by Robin »

appleide wrote:1 mark for getting part a) correct. XD
Yay!
appleide wrote:So I made it a one-way binding, it's always bounded to what ever value is in the top textfield, resulting it being uneditable as a side-effect.
I had an idea that was be the case. However, wouldn't making the second textfield readonly be more logical to the user? For the little demo it doesn't matter much, but I can imagine people would want to do that in their games. Do textfields have a .readonly property?
Help us help you: attach a .love.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield, scrollVIew

Post by appleide »

Yes; .enabled.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: LoveUI... has button, Textfield, scrollVIew

Post by Robin »

Is the user able to select the component if .enabled = false?
Help us help you: attach a .love.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield, scrollVIew

Post by appleide »

you mean:
aTextfield.enabled=false?
yes.
:)
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield, scrollVIew

Post by appleide »

Here's a new demo that stops using deprecated features. (lols) It also uses enabled to disable second textfield too. Otherwise the library is exactly the same as before.
Attachments
LoveUI(alpha).love
(79.68 KiB) Downloaded 141 times
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: LoveUI... has button, Textfield, scrollVIew

Post by Robin »

appleide wrote:It also uses enabled to disable second textfield too.
It's more intuitive this way, I think ^^.

(Somehow I always find clicking the "Launch Missile" button disturbingly satisfying :joker:.)
Help us help you: attach a .love.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield, scrollVIew

Post by appleide »

I have received some complaints:
My game is more dark. So the white background of the textfield are not good.
I'm start to change the color but nothing seems applied, with :

Code: Select all

aTextfield.backgroundColor=love.graphics.newColor(0, 150, 150, 10)
same for :

Code: Select all

aTextfield.image=nil
I finaly choose :

Code: Select all

aTextfield.opaque=false
And the background become dark \o/

After that I change the text color, but the cursor are still black.
This is my small change : the cursor follow the text color.

In Library/LoveUI/LoveUITextfieldCell.lua :

In LoveUI.TextfieldCell:drawSelection function :
Before:

Code: Select all

                        if self.showCursor and view.isFirstResponder then
                                LoveUI.graphics.setColor(0,0,0,255)
After:

Code: Select all

                        if self.showCursor and view.isFirstResponder then
                                LoveUI.graphics.setColor(self.controlView.textColor)

Another thing.
I put your LoveUI (alpha) in a sub directory :
myproject/main.lua
myproject/lib/
myproject/external/loveuialpha/
myproject/external/loveuialpha/Library/class.lua
myproject/external/loveuialpha/Library/LoveUI/LoveUI.lua

I have no problem in my main.lua to load the class.lua and LoveUI.lua
but You have in LoveUI.lua a hardcoded PATH :

Code: Select all

        local PATHS={}
        PATHS.LIBRARY_DIR="Library";
It will be great if you (in futur version) let this dynamic.
And updated it :)
I've fixed the textfield's backgroundcolor and the cursor being same as textcolor.
Also... from now on:
If you have a folder named "Library", "library", "lib" or "libs", then the LoveUI and the class.lua MUST reside in that folder. (If you have more than one of those, then it ONLY checks the first one found, in the order I listed them.)

If you don't, you have to call LoveUI.loadLoveUIFrom(newPath) after requiring LoveUI.lua.
e.g, for myproject/external/loveuialpha/Library/LoveUI/LoveUI.lua
You'd call

Code: Select all

LoveUI.loadLoveUIFrom("external/loveuialpha/Library")
right after the require("external/loveuialpha/Library/LoveUI/LoveUI.lua") (or similar) statement to finish loading.
If you have one of the folder I've listed then you CANNOT call this.

class.lua still has to be on the same level as LoveUI folder, however.

This release is now 'beta'.
Attachments
LoveUI(beta).love
(77.13 KiB) Downloaded 138 times
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

LOVEUI UNSTABLE VERSION

Post by appleide »

This is a new version with new features:
Changelog wrote: 2 June 2009

-Library Loading Code. Requires SECS by bartbes, if class function is absent, will load SECS from its own folder.
Just require the LoveUI.lua file inside LoveUI and it'll look for the lib by itself.
Your library folder can have any names and LoveUI can be placed anywhere in your package.
Just make sure the library's name stays "LoveUI".

-Removed deprecated "LoveUI.EventMouseEntered=2; LoveUI.EventMouseExited=3;" Events

-LoveUI.DEFAULTFONT, LoveUI.SMALLFONT changed to LoveUI.DEFAULT_FONT, LoveUI.SMALL_FONT

-Button no longer uses .title. Use .value instead

-TableView half finished.
It now searches for itself anywhere in the package rather than in one of the specific folders, and you don't need to call anything, or require SECS first (if you don't the lib has its own copy). (But you have to use SECS for classes)

I'm also doing the TABLEVIEW, a list with multiple columns. and I DONT KNOW WHAT THE HEADERS SHOULD LOOK LIKE! Please download and look at the demo and then tell me what you think would suit it best. and how the rest of the table should look like. Thanks.

This version contains unstable features. Use with caution. May need source changes to adapt to this one.
Attachments
LoveUI(unstable).love
(82.16 KiB) Downloaded 131 times
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: LoveUI... has button, Textfield, scrollVIew

Post by bartbes »

I guess it should be less button, but I think it's fine already. I do want selection though.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests