Page 2 of 5

Re: GUI libraries...

Posted: Thu Jun 23, 2011 1:19 am
by RPG
Please write examples of code, which you would like to use to create the GUI. This will help me with the creation of the library (in any case I'm going to develop GUI system based on lQuery).

GUI library should contain:
1. Styles - everyone wants to create his own GUI style, styles must be easy to understand (CSS is a good example)
2. Event system (lQuery already has event system), actions and callbacks.
3. Widgets - buttons, textboxes, etc.
4. Layouts - to place widgets in order, to align widgets (like QT layouts). It's easier than manually alignment.

There is problem with scrolling widgets - there is no way to do it except framebuffers. But framebuffers may be slow.

Re: GUI libraries...

Posted: Fri Jun 24, 2011 4:27 pm
by Ensayia
I'm incredibly tempted to take a shot at this myself, as I am one of the few forum members who has contributed very little here.

Re: GUI libraries...

Posted: Fri Jun 24, 2011 5:17 pm
by RPG
You want to create your own GUI library? Perhaps forum users should join forces?

Re: GUI libraries...

Posted: Fri Jun 24, 2011 6:04 pm
by Ensayia
I meant I was incredibly tempted to create and share my own version of an easy to use GUI for the community.

Re: GUI libraries...

Posted: Fri Jun 24, 2011 7:43 pm
by RPG
ok, this is my vision of GUI lib:

Styles:

Code: Select all

class button {
border = 1
border_color = {0, 0, 0}
color = {128,128,128}
}

class button : hover {
color = {64,64,64}
}

class layout {
border = 3
border_color = {64,64,64}
}

class text_input {
background = "images/background.png"
}
Create widgets:

Code: Select all

layout = Entity:new(screen):newLayout({layout = "horisontal", align = "center", valign = "top", padding = 10}):size(800, 600):style("layout")
--buttons
Entity:new(layout):newButton("New game"):size(100, 30):click(newGame):style("button")
Entity:new(layout):newButton("Load game"):size(100, 30):click(loadGame):style("button")
Entity:new(layout):newButton("Quit"):size(100, 30):click(love.exit):style("button")

Re: GUI libraries...

Posted: Fri Jun 24, 2011 9:11 pm
by nevon
Being able to style widgets is all well and good, but 99 times out of 100, I'm going to want to use images rather than just crude background color + border.

Re: GUI libraries...

Posted: Sat Jun 25, 2011 1:59 am
by RPG
RPG wrote:

Code: Select all

class text_input {
background = "images/background.png"
}
Also may be:

Code: Select all

class text_input {
border_image = ("images/background.png", 10,10,10,10}
}
Example: http://www.css3.info/preview/border-image/

lQuery can help you to display border-image.

Re: GUI libraries...

Posted: Sat Jun 25, 2011 7:14 am
by Robin
Guys. You do know that's not valid Lua, right?

Re: GUI libraries...

Posted: Sat Jun 25, 2011 9:02 am
by RPG

Code: Select all

class.text_input = {
background = "images/background.png"
}
This is just concept

Re: GUI libraries...

Posted: Sat Jun 25, 2011 10:15 pm
by Ensayia
I don't understand the need to implement something like this in lQuery anyway. Is it really necessary to use a framework (lQuery) on top of another framework (LOVE) for doing a GUI? This sort of thing will be inherently difficult for a newbie to grasp.