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.
LoveUI for Love 0.5.0
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: LoveUI... has button, Textfield, scrollVIew
Yay!appleide wrote:1 mark for getting part a) correct. XD
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?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.
Help us help you: attach a .love.
Re: LoveUI... has button, Textfield, scrollVIew
Yes; .enabled.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: LoveUI... has button, Textfield, scrollVIew
Is the user able to select the component if .enabled = false?
Help us help you: attach a .love.
Re: LoveUI... has button, Textfield, scrollVIew
you mean:
aTextfield.enabled=false?
yes.
aTextfield.enabled=false?
yes.
Re: LoveUI... has button, Textfield, scrollVIew
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
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: LoveUI... has button, Textfield, scrollVIew
It's more intuitive this way, I think .appleide wrote:It also uses enabled to disable second textfield too.
(Somehow I always find clicking the "Launch Missile" button disturbingly satisfying .)
Help us help you: attach a .love.
Re: LoveUI... has button, Textfield, scrollVIew
I have received some complaints:
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
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'.
And updated itMy 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 :same for :Code: Select all
aTextfield.backgroundColor=love.graphics.newColor(0, 150, 150, 10)
I finaly choose :Code: Select all
aTextfield.image=nil
And the background become dark \o/Code: Select all
aTextfield.opaque=false
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:After:Code: Select all
if self.showCursor and view.isFirstResponder then LoveUI.graphics.setColor(0,0,0,255)
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 :It will be great if you (in futur version) let this dynamic.Code: Select all
local PATHS={} PATHS.LIBRARY_DIR="Library";
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")
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
LOVEUI UNSTABLE VERSION
This is a new version with new features:
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.
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)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.
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
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: LoveUI... has button, Textfield, scrollVIew
I guess it should be less button, but I think it's fine already. I do want selection though.
Who is online
Users browsing this forum: No registered users and 2 guests