GUI libraries...

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
RPG
Party member
Posts: 157
Joined: Wed Mar 02, 2011 5:02 am
Location: Russia
Contact:

Re: GUI libraries...

Post 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.
User avatar
Ensayia
Party member
Posts: 399
Joined: Sat Jun 12, 2010 7:57 pm

Re: GUI libraries...

Post 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.
User avatar
RPG
Party member
Posts: 157
Joined: Wed Mar 02, 2011 5:02 am
Location: Russia
Contact:

Re: GUI libraries...

Post by RPG »

You want to create your own GUI library? Perhaps forum users should join forces?
User avatar
Ensayia
Party member
Posts: 399
Joined: Sat Jun 12, 2010 7:57 pm

Re: GUI libraries...

Post by Ensayia »

I meant I was incredibly tempted to create and share my own version of an easy to use GUI for the community.
User avatar
RPG
Party member
Posts: 157
Joined: Wed Mar 02, 2011 5:02 am
Location: Russia
Contact:

Re: GUI libraries...

Post 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")
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: GUI libraries...

Post 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.
User avatar
RPG
Party member
Posts: 157
Joined: Wed Mar 02, 2011 5:02 am
Location: Russia
Contact:

Re: GUI libraries...

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: GUI libraries...

Post by Robin »

Guys. You do know that's not valid Lua, right?
Help us help you: attach a .love.
User avatar
RPG
Party member
Posts: 157
Joined: Wed Mar 02, 2011 5:02 am
Location: Russia
Contact:

Re: GUI libraries...

Post by RPG »

Code: Select all

class.text_input = {
background = "images/background.png"
}
This is just concept
User avatar
Ensayia
Party member
Posts: 399
Joined: Sat Jun 12, 2010 7:57 pm

Re: GUI libraries...

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests