Howdy all,
Man its been a while, I recently got the wild hair to start again on my restaurant simulation again (2D style like Pizza Tycoon). The one thing that killed me was spending too much time (Way too much time) trying to create my own GUI. Since my core simulation was complete (mathematically at least) mucking around with a GUI got old really fast. I'd much rather be improving and adding to my Sim core instead.
Anyway, I came across two possible solutions: Quickie and LoveFrames. Quickie was indeed simple and straight forward to use but lacked customization. The coding by Ricther is far beyond my knowledge to deal with. In fact, it seems Quickie was nothing more then an experiment. Too bad, cuz there's no way I could implement something like this in his code:
-- Draw the gui. Colors can be changed using the gui.core.color table:
-- gui.core.color.hot = {fg = {r,g,b,a}, bg = {r,g,b,a}}
-- gui.core.color.active = {fg = {r,g,b,a}, bg = {r,g,b,a}}
-- gui.core.color.normal = {fg = {r,g,b,a}, bg = {r,g,b,a}}
-- or by passing different draw functions to the widgets.
I'd guess that being able to customize button appearance and such was next on his list. Again, too bad.
On the other side was the monstrous LoveFrames. Not so easy to deal with, but pretty much does it all. For my project, this seems like way too much overhead. And it's likely to take me a huge amount of time trying to strip down the code base <- Don't even think this newbie knows what he talks about.
So then, is there any form of canned GUI that sits between Quickie and LoveFrames? Wait, I can guess the answer even now. NO? So what would you folks suggest I do? Should I dig in and modify the limited Quickie code base, or just latch unto LoveFrames --> Cuz chances are I might actually need to use the stuff from LoveFrames in the future???
Crap, as I typed this I just noticed Love2d is now 0.9.2. Oh boy. What gets improved and/or broken.
A thousand times. What GUI?
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: A thousand times. What GUI?
What was the last love version you have used? And DOMy is a new one and it is ready for testers.
Re: A thousand times. What GUI?
I built Thranduil https://www.love2d.org/forums/viewtopic.php?f=5&t=79553 with such customizations in mind so maybe it solves your problem? It's not finished yet and there are few examples (2 only), but if you can figure those out you should be able to customize it however you want pretty easily.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: A thousand times. What GUI?
I would go with LoveFrames, since it has more users and has been more tested than all the others.
That said, I seem to remember that Quickie did in fact have customization options; they were a bit hacky and rough. You have to create your own "style" (a table with functions and other stuff inside, encoding how everything is drawn) and replace the "default style" with yours.
My recommendation would be : Start by copying style-default.lua, giving it a different name (like my-style.lua). Then change whatever you want (Quickie might be a bit difficult, but the style stuff is straightforward), and then require and set it like this:
I have not tried this (I only dabbled with Quickie a little bit) but it should work with little or no change.
That said, I seem to remember that Quickie did in fact have customization options; they were a bit hacky and rough. You have to create your own "style" (a table with functions and other stuff inside, encoding how everything is drawn) and replace the "default style" with yours.
My recommendation would be : Start by copying style-default.lua, giving it a different name (like my-style.lua). Then change whatever you want (Quickie might be a bit difficult, but the style stuff is straightforward), and then require and set it like this:
Code: Select all
local my_style = require 'my-style' -- assuming your style is called my-style.lua
local gui = require "Quickie"
gui.core.style = my_style -- this should replace the default style with yours
When I write def I mean function.
Re: A thousand times. What GUI?
I have, and it works perfectly fine. I went for a simple "flat" UI, and I realy like Quickie's way of assembling layouts without specifying everything pixel-perfect.kikito wrote: My recommendation would be : Start by copying style-default.lua, giving it a different name (like my-style.lua). Then change whatever you want (Quickie might be a bit difficult, but the style stuff is straightforward), and then require and set it like this:
I have not tried this (I only dabbled with Quickie a little bit) but it should work with little or no change.Code: Select all
local my_style = require 'my-style' -- assuming your style is called my-style.lua local gui = require "Quickie" gui.core.style = my_style -- this should replace the default style with yours
Re: A thousand times. What GUI?
Thanks dudes, I appreiciate the replies. I'll also give out a salute to anyone attempting to create a functional GUI. This newbie thinks that it isn't exactly the easiest thing to do.
Luckily, I'm learning how to use tortiseHG [win] for versioning, so I can branch off and test various GUI implements without destroying my initial code base. So far I've dabbled with each mentioned GUI except Domy. And if there's one thing I truly learned, it's that the lack of either one or both of documentation or examples causes much hair pulling. With Quickie, there was practically nothing to go on. But after a few clumps of hair and a comb over, I finally started to get what it was doing. Even managed to customize it rather nicely. Too bad it wasn't maintained. I rather liked how the grouping and the straightforward coding worked.
For Thranduil, the lack of decent examples to go by caused even more hair pulling. I did manage to create a decent menu system for my project although and I may even go back to using the library. However, the need to create drawing code for everything got old pretty quick. Plus, the time it took to code up experiments to try and figure out how the library worked made it all much worse. Come to think of it, Thranduil didn't play nice when the L2d joystick module is set to false in conf.lua.
So finally there was Loveframes. Big thanks to kikito for mentioning why it might be they way to go. I think it took less then an hour or so to flesh out my entire menu system. Decent documentation (Not perfect), plenty of examples, and some demo code made this so much easier to deal with. Probably should have went with Loveframes first. And as I've learned, customizing this isn't going to be easy either, although there are some nifty time saving ideas to work with.
Anyway, thanks again.
Luckily, I'm learning how to use tortiseHG [win] for versioning, so I can branch off and test various GUI implements without destroying my initial code base. So far I've dabbled with each mentioned GUI except Domy. And if there's one thing I truly learned, it's that the lack of either one or both of documentation or examples causes much hair pulling. With Quickie, there was practically nothing to go on. But after a few clumps of hair and a comb over, I finally started to get what it was doing. Even managed to customize it rather nicely. Too bad it wasn't maintained. I rather liked how the grouping and the straightforward coding worked.
For Thranduil, the lack of decent examples to go by caused even more hair pulling. I did manage to create a decent menu system for my project although and I may even go back to using the library. However, the need to create drawing code for everything got old pretty quick. Plus, the time it took to code up experiments to try and figure out how the library worked made it all much worse. Come to think of it, Thranduil didn't play nice when the L2d joystick module is set to false in conf.lua.
So finally there was Loveframes. Big thanks to kikito for mentioning why it might be they way to go. I think it took less then an hour or so to flesh out my entire menu system. Decent documentation (Not perfect), plenty of examples, and some demo code made this so much easier to deal with. Probably should have went with Loveframes first. And as I've learned, customizing this isn't going to be easy either, although there are some nifty time saving ideas to work with.
Anyway, thanks again.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests