Löve Frames - A GUI Library

Showcase your libraries, tools and other projects that help your fellow love users.
mode7
Prole
Posts: 35
Joined: Tue Aug 21, 2012 5:45 pm
Contact:

Re: Löve Frames - A GUI Library

Post 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.
User avatar
Nikolai Resokav
Party member
Posts: 140
Joined: Wed Apr 28, 2010 12:51 am
Location: United States

Re: Löve Frames - A GUI Library

Post 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.
mode7
Prole
Posts: 35
Joined: Tue Aug 21, 2012 5:45 pm
Contact:

Re: Löve Frames - A GUI Library

Post 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.
Delta9
Prole
Posts: 11
Joined: Mon Nov 12, 2012 5:01 am

Re: Löve Frames - A GUI Library

Post 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.
User avatar
Nikolai Resokav
Party member
Posts: 140
Joined: Wed Apr 28, 2010 12:51 am
Location: United States

Re: Löve Frames - A GUI Library

Post 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?
Delta9
Prole
Posts: 11
Joined: Mon Nov 12, 2012 5:01 am

Re: Löve Frames - A GUI Library

Post 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 :)
User avatar
Nikolai Resokav
Party member
Posts: 140
Joined: Wed Apr 28, 2010 12:51 am
Location: United States

Re: Löve Frames - A GUI Library

Post 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.
Delta9
Prole
Posts: 11
Joined: Mon Nov 12, 2012 5:01 am

Re: Löve Frames - A GUI Library

Post 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.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Löve Frames - A GUI Library

Post 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?
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
Nikolai Resokav
Party member
Posts: 140
Joined: Wed Apr 28, 2010 12:51 am
Location: United States

Re: Löve Frames - A GUI Library

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

Who is online

Users browsing this forum: No registered users and 4 guests