Page 11 of 41
Re: Löve Frames - A GUI Library
Posted: Tue Nov 06, 2012 5:16 pm
by mode7
Hey, first of all thank you very much Nikolai for Löve Frames, it is amazing what you can do with it.
I'm just getting started and there are some things I don't understand just yet I did not find them in the documentation, that's why I'll ask them here.
Most important for me is to close and restore a window. It seemed trivial first but I can't figure out a simple way to do it.
Löveframes seems to keep an internal array of all objects. When I close a window, i mean frame, it seems to delete the frame and its dependent objects. Right?
So how do I restore them again? Just recreating them? This will lead to multiple copies of the same window even if i set them to the same variable. I'm sure there's some solution to this, bit I don't really see it yet.
Re: Löve Frames - A GUI Library
Posted: Tue Nov 06, 2012 5:24 pm
by Nikolai Resokav
mode7 wrote:Hey, first of all thank you very much Nikolai for Löve Frames, it is amazing what you can do with it.
I'm just getting started and there are some things I don't understand just yet I did not find them in the documentation, that's why I'll ask them here.
Most important for me is to close and restore a window. It seemed trivial first but I can't figure out a simple way to do it.
Löveframes seems to keep an internal array of all objects. When I close a window, i mean frame, it seems to delete the frame and its dependent objects. Right?
So how do I restore them again? Just recreating them? This will lead to multiple copies of the same window even if i set them to the same variable. I'm sure there's some solution to this, bit I don't really see it yet.
You can't restore a frame once it has been closed. If you are looking to hide a frame for a certain amount of time and then use it later, you should use the SetVisible method.
Re: Löve Frames - A GUI Library
Posted: Tue Nov 06, 2012 8:03 pm
by mode7
Thanks for the quick answer!
Now I feel kind of stupid. I didn't think of this. Thank you very much!
I made a very small modification to the close button to hide the frame instead of removing it - works like a charm.
Re: Löve Frames - A GUI Library
Posted: Mon Dec 10, 2012 12:20 pm
by Delta9
Here's to feeling stupid! I know, this is as trivial as it gets, but I am stuck on set-up here.
My main.lua is in directory desktop/wip, and I have your library in /wip/libs/LoveFrames-master, exactly as in the zip, but I cannot for some reason get the Directory to work right in init.lua.
How should this be formatted? Thanks in advanced, looking forward to implementing this.
Re: Löve Frames - A GUI Library
Posted: Mon Dec 10, 2012 1:50 pm
by Nikolai Resokav
Delta9 wrote:Here's to feeling stupid! I know, this is as trivial as it gets, but I am stuck on set-up here.
My main.lua is in directory desktop/wip, and I have your library in /wip/libs/LoveFrames-master, exactly as in the zip, but I cannot for some reason get the Directory to work right in init.lua.
How should this be formatted? Thanks in advanced, looking forward to implementing this.
The correct setting for loveframes.config["DIRECTORY"] would be "libs/LoveFrames-master" in that scenario. What exactly is the problem though? Are you getting any errors?
Re: Löve Frames - A GUI Library
Posted: Mon Dec 10, 2012 2:18 pm
by Delta9
Code: Select all
ERROR
libs/LoveFrames-master/int.lua:42: attempt to concatenate local 'dir' (a nil value)
it is set up exactly as described, with the path I described. Gonna go over the whole thing again to be sure. Thanks for the quick response.
and as I look at what I just posted the problem becomes immediately apparent in it looking for int.lua instead of init.lua
Re: Löve Frames - A GUI Library
Posted: Mon Dec 10, 2012 2:26 pm
by Nikolai Resokav
Delta9 wrote:Code: Select all
ERROR
libs/LoveFrames-master/int.lua:42: attempt to concatenate local 'dir' (a nil value)
it is set up exactly as described, with the path I described. Gonna go over the whole thing again to be sure. Thanks for the quick response.
No problem. Let me know if you have any more questions.
Re: Löve Frames - A GUI Library
Posted: Mon Dec 10, 2012 2:31 pm
by Delta9
Thanks kindly, working great, not sure how I accidentally changed something, but unzipping a fresh copy fixed it first try. Now to get my hands dirty.
Re: Löve Frames - A GUI Library
Posted: Fri Dec 28, 2012 11:02 pm
by Karai17
Hey mate, awesome library! Is it possible to "instance" LoveFrames in a way that only a certain set of elements are active during a particular gamestate? Or is the recommended method to simply hide elements that are not currently needed?
Re: Löve Frames - A GUI Library
Posted: Fri Dec 28, 2012 11:21 pm
by Nikolai Resokav
Karai17 wrote:Hey mate, awesome library! Is it possible to "instance" LoveFrames in a way that only a certain set of elements are active during a particular gamestate? Or is the recommended method to simply hide elements that are not currently needed?
Love Frames does not currently support gamestate instancing, although this might be added in the future. My suggestion is to create each element you need for a state when the state loads and then store them in a table. Then when the state changes you can loop through the table you stored the elements in and remove or hide them.