LoveUI for Love 0.5.0

Showcase your libraries, tools and other projects that help your fellow love users.
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: LoveUI... The next generation in gui development.

Post by osuf oboys »

Hi, and thank you for the comments. I see that we have quite different opinions about this topic and as they are intuitive judgments about empirical phenomena, the discussion may very well come to a halt with neither one of us conveying the other without. The key difference here, I believe, is our respective background in software development that we relate the issues to and the perspective we take in judging the worth of the endeavor, e.g. by the value we put in sharing and reusing code. For the present state of LÖVE, I certainly agree with your opinion that standardization has little to offer. In time though, perhaps just a few months, I believe that it will be quite the contrary and the lack of standardization will severely impede the advancement of the LÖVE community. However, for the above reasons, I have little to show for these arguments, save for relating to the success and importance of other communities where standardization and structure have been essential to these successes, and relating failures in other respects to the very lack of the same. Note that I'm not saying that any standardized format should be obligatory, rather recommended.
appleide wrote:Personally I believe gui's aren't really favoured or even desired when one creates a love app at the moment. When you create a game, do you really need anything else besides buttons and textfields and the occasional dialog? These three elements are easily built, so most people would like to rebuild them themselves using some effort even if libraries are available, simply because they like to control how it turns out (the reward). i.e, the reward/effort ratio is high, up to the point of buttons+textfield and occasional other widget. Until you've got people creating complex applications and games people wouldn't really use the gui's out there...
I disagree with these sentiments. Yes, many games only require a few and relatively "simple" GUI elements (although I doubt most LÖVE users would consider a text box that simple), but they still need them and have to reinvent code that could easily be shared. Some may want to make the code up on their own but others may wish to choose some ready framework to put their attention elsewhere. Note how the very choice of using LÖVE is an act that falls in the second category. Note that there's ample room for development of GUI elements besides the foundational framework, such as the look of widgets, layouts, and defauly behavior. The typical checking whether a mouse click was in a button or having keypresses be read in when a text box is highlighted, these are steps that I believe most designers of LÖVE games to consider rudimentary and of lesser interest. To find a nice design of a button and to code the effects of a button, this is where I believe the real interest lies for most.
I'm simply creating my own gui for my own use because I'd like to control how it turns out, and how it would appear in my apps that I happen to create. I put it here so others can copy parts of it to build their own guis for use in their own programs.
I'm definitely not forcing you to disband your project. If it's fun, go on. You could even do both. Although I believe that how interesting things are very well depends on the considered time frame and prospects.
If people end up using one particular gui unmodified, en mass, then 'compatibility' becomes a bonus! I am however more receptive to the idea that individual groups take the best ideas from everyone and adds their own elements. Eventually though, there might be a project that shines so brightly (because of previous work by other people composed in a brilliant way) that everyone drops what they're doing and go to it...
If they choose to, that would be fine. The problem is still with the compatibility. To relate to the standardization, the need of frameworks, or structure, just imagine someone writing a boss script for LÖVE. How would this work? There's no common way to define, say, health, or the commanding of units. This would be the case even among games that do have these features. The lack of a common way to express these things hurts the development. All is not lost however, we could still make the shapes of the boss, animations, and the like. For movement (without interaction with the rest of the system outside box2d), we could simply create an update function for the boss. Likewise, we could even draw the boss by defining a draw function, everyone knows how to use those. This is the structure that belongs to the present folklore of the LÖVE community and does allow for code dissemination and reusability. I would very much like to see LÖVE scripts were created, shared, and implemented as easily as, say, scripts for the modern RPG makers. (more easily, I'd wager, considering how poorly the base system is made) There is now way to reach this without introducing some standards. Standards that serve to structure information, not to specialize it. In the immediate future, I can see at least one framework that would rely on a GUI - a level editor. A level editor is really easy to make for games relying on box 2d games as soon as we have defined a basic standardized lua class. Without box 2d, it should still be easy if we have a common framework for defining sprites and the like.
However I'm not really enlightened to the idea of making everyone working in the same thing. To make any changes you'd need majority of people to agree with it. It'd make the development process slower. There is also communication overhead; You'd need everyone to understand everyone's code, which would be an effort in itself.
Yes, development speed should falter while quality of the ready product should improve. I'm not telling you how to do it, but I would rather argue that changes are made as long as there's an argument for there and no argument against. Changes could certainly be made and discussed afterward. You certainly do not need to understand all the code. Most of the time, edits are checked by other people that care of the project and can comment or edit if the changes do not fit their standards.
Also, there ends up being no choice for anyone who comes along, if they happen to dislike the 'default' gui everyone is working on. They might just build their own, which they believe is better! And we've just come back from the other side of the circle.
If they can argue for their cause, they should, given enough time, have as much say as anyone else. Anyone is free to do otherwise, but they risk having to put in more time and work to make things compatible. Unless a large enough portion of the community starts to use the new system, you would not be back to where you started.
A software development team is but a couple of programmers and supporting artists and documentation-writers. A team bigger than that would simply bog itself down. If you're a programmer who knows how to create basic art, its half a team already![/quoted]
For a particular end product, perhaps. To elevate human's body of knowledge, be it software for game develöpment or otherwise, I disagree.
I've uploaded a new version with zlib license inside. You can use any part of it as per license. :)
Thank you, but I was wondering if, in the event that parts of those files would be reused, we could do so without having to accompany the resulting scripts with a copyright notice.
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... The next generation in gui development.

Post by appleide »

osuf boys wrote: In time though, perhaps just a few months, I believe that it will be quite the contrary and the lack of standardization will severely impede the advancement of the LÖVE community.
What's difficult about standardizations is they are not easy to implement. Once you do, you also have to convince people to abide to it. If they don't then its useless. One way to do this is simply hard coding things, like LOVE has done with the update and draw functions, which works very well as you pointed out. I'm not against all standardizations if you can achieve it. I am just sceptical whether you can at this stage, and a hesitant for reasons below. :brows:
osuf boys wrote: There's no common way to define, say, health, or the commanding of units. This would be the case even among games that do have these features. The lack of a common way to express these things hurts the development.
I'm not sure I understand you 100% here... but the fact that there isnt a standard way of "managing health of bosses" is good! You might want a boss which is not made of a single part with HP, but many parts, which when hit by bullets, has a probability of falling off; There could be no HP involved! The lack of standardization improves the diversity of programs that can be written! Of course it isn't one extreme or the other; You'd have to figure out the optimal level of standardizations. Standardizing classes I might agree with, but I might hesistate at standardizing how widgets are made, and managed by the LOVE engine. How do you know you're using the best approach? You don't, and someone might come along and write something brilliant if only there was no standard (And if there was then the situation wouldn't be pleasant; you'd have some people jumping off the standard, etc;[1]), and thats why I'm some what hesitant standardizing anything beyond classes.

[1]: To prevent this, things can be hard coded, but that also prevents further brilliance... For example, someone figure out a better update and draw loop, they wouldn't post it here! because they can't do anything to change, since its hard coded. The draw/update loop is simple and it is easy to see the optimal ways to handle them, however, just like solving a tower of hanoi with height = 3 can only done in at least 7 moves. With more complicated things I'm certainly more than a bit hesitant about hard coding...
osuf boys wrote: Yes, many games only require a few and relatively "simple" GUI elements (although I doubt most LÖVE users would consider a text box that simple), but they still need them and have to reinvent code that could easily be shared.
They only have to reinvent it if the code isn't shared... but it is! Almost all projects posted in the forums are shared, with very liberal licenses to boot! (And I do think we should all use the same license when we want to share stuff, but choosing a particular license is difficult; not everyone will agree to the same one.) People just have to grab the code from existing sources and add their own modifications to create their own widgets.
Thank you, but I was wondering if, in the event that parts of those files would be reused, we could do so without having to accompany the resulting scripts with a copyright notice.
What about modifying the license thus:

Code: Select all

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must not be misrepresented as being the original
      software.
  3. If you redistribute this software in its entirety without modifications, This
      notice may not be removed or altered from any source distribution.
I'm not sure if such modification is necessary, however. If you're just going to copy bits of code then it wouldn't really be "source distribution", would it? You wouldn't be "removing or altering" the notice either...


P.S:
osuf boys wrote: However, for the above reasons, I have little to show for these arguments, save for relating to the success and importance of other communities where standardization and structure have been essential to these successes, and relating failures in other respects to the very lack of the same.
I'd like some specific examples please :)
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield

Post by appleide »

I've added the textfield. Also added keyEvents and update loop. Fixed the mistake where I put "dt" into "draw()" so it became "draw(dt)"... :oops:

EDIT: working on adding support for letters like "ö".. though it wouldn't be easy and I might not be able to do it well.
User avatar
S-Rave
Prole
Posts: 39
Joined: Wed Feb 25, 2009 4:41 pm

Re: LoveUI... has button, Textfield

Post by S-Rave »

Which widgets did you have planned?
srejv
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield

Post by appleide »

appleide wrote: I'm hoping, in the future, it'll come with not only buttons, textfields, dialogs, checkboxes, radiobuttons but also tables, multiline textviews, scrollable views and even more
It's a rough plan. I just work on what I feel like next. ^^
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield

Post by appleide »

I've uploaded a new version. This one is a *real* .love file. i.e, it actually works... Fixed a textfield bug, added "Layer", which will be the basis of the next widget "Panel" (Some sort of non-user-resizable window that can be closed with an 'x' button.)
User avatar
whitebear
Citizen
Posts: 86
Joined: Sun Mar 15, 2009 1:50 am

Re: LoveUI... has button, Textfield

Post by whitebear »

Nice.
I fancy how you did those text fields (the text pointer and text hiding when you type more than text field has space)
Now it only seems to be missing the function to move the layers (this should be optional though.)
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield

Post by appleide »

whitebear wrote:Nice.
I fancy how you did those text fields (the text pointer and text hiding when you type more than text field has space)
Now it only seems to be missing the function to move the layers (this should be optional though.)
Scissor boxes. It's the lazy way; if you type like several hundred characters into the textfield it'd lag. :brows:

function to move layers: I'll do that in 'panel'. :)
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield

Post by appleide »

Panel implemented.
Clicky: http://love2d.org/forum/viewtopic.php?f ... 4880#p4880

A major change to the way drawing in this library works...
Say this is was a pseudo-function for Button:

Code: Select all

function button:display() 
  local loc=button:convertPoint(self.location)
  love.graphics.draw(self.image, loc.x, loc.y)
end
the equivalent now is changed to....

Code: Select all

function button:display() 
  love.graphics.draw(self.image, 0, 0)
end
I'm slightly worried about it, because mouse locations haven't been similarly 'localised'.... That's why I'm keeping the old version up for now.
I might do the same to the mouse too.

Of course, this doesn't affect drawing outside the library in anyway, unless you're in that special case shown in my new uploaded example.

Added in-progress documentation, and other minor changes.
User avatar
Kaze
Party member
Posts: 189
Joined: Sat Jul 19, 2008 4:39 pm
Location: Dublin, Ireland

Re: LoveUI... has button, Textfield

Post by Kaze »

Line 256 of LoveUI.lua,

Code: Select all

return x+translate_x, y+translate_y, w, h
Should be:

Code: Select all

return x-translate_x, y-translate_y, w, h
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 215 guests