Löve Frames - A GUI Library

Showcase your libraries, tools and other projects that help your fellow love users.
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 » Sat Jan 03, 2015 11:36 am

tommyroyall wrote:Thank you so much for looking into this Nikolai! Loveframes has been used in numerous past projects and proves vital for this one, and the file that it is called in from is main.lua, though the one that is giving me issues would be CabinGamestate.lua. At the same time, the first one that is opened is MenuGamestate.lua. Here is the download link to the .love file, http://www.mediafire.com/download/eyil1 ... 30-14.love
On line 87 in main.lua, change require "libs/loveframes" to loveframes = require "libs.loveframes".

Slover
Prole
Posts: 1
Joined: Sun Jan 04, 2015 3:45 am

Re: Löve Frames - A GUI Library

Post by Slover » Sun Jan 04, 2015 3:59 am

Is it possible to hide child content outside of a parents bounds? So something like:

local frame = loveframes.Create("frame")
frame:SetSize(100, 100)

local panel = loveframes.Create("panel", frame)
panel:SetSize(50, 50)
panel:SetPos(25, 75)

Wouldn't have a panel sticking out the side of the frame.

User avatar
Doctory
Party member
Posts: 439
Joined: Fri Dec 27, 2013 4:53 pm

Re: Löve Frames - A GUI Library

Post by Doctory » Mon Jan 05, 2015 5:55 pm

hi :)
ive actually started using this library on a project now and its awesome
although, i have one problem.
when my project reaches max objects, i added a tool tip that will say max objects reached.
the tool tip is tied to a panel that is moved to the mouse position. when the max objects are reached, the tooltip works but it flickers.
any ideas?
thanks.
Attachments
physics.love
(147.26 KiB) Downloaded 90 times
"This is what videogames should be like; they should have meaning and triple machine guns"
- Jan Willem Nijman, 2013
github

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 » Tue Jan 06, 2015 1:26 pm

Slover wrote:Is it possible to hide child content outside of a parents bounds? So something like:

local frame = loveframes.Create("frame")
frame:SetSize(100, 100)

local panel = loveframes.Create("panel", frame)
panel:SetSize(50, 50)
panel:SetPos(25, 75)

Wouldn't have a panel sticking out the side of the frame.
You can use a stencil for that: http://www.love2d.org/wiki/love.graphics.setStencil
Doctory wrote:hi :)
ive actually started using this library on a project now and its awesome
although, i have one problem.
when my project reaches max objects, i added a tool tip that will say max objects reached.
the tool tip is tied to a panel that is moved to the mouse position. when the max objects are reached, the tooltip works but it flickers.
any ideas?
thanks.
The problem seems to be that you are updating Love Frames before the editor. Changing your update code in main.lua so that loveframes.update gets called after editor.update seemed to fix the issue for me.

User avatar
Doctory
Party member
Posts: 439
Joined: Fri Dec 27, 2013 4:53 pm

Re: Löve Frames - A GUI Library

Post by Doctory » Tue Jan 06, 2015 1:39 pm

thanks, it doesnt flicker now.
"This is what videogames should be like; they should have meaning and triple machine guns"
- Jan Willem Nijman, 2013
github

User avatar
Guard13007
Party member
Posts: 126
Joined: Sat Oct 25, 2014 3:42 am
Location: Internet, USA
Contact:

Re: Löve Frames - A GUI Library

Post by Guard13007 » Fri Jan 16, 2015 6:15 am

Hi, I have been using LoveFrames in a couple different projects, and I recently wanted to make a menu object that you can open by right-clicking anywhere on screen. (I think I am understanding that is what the menu object is for?)

I have this currently:

Code: Select all

	local menu = lf.Create("menu")
	menu:AddOption("Email", false, function() end)
	menu:AddOption("Spreadsheets", false, function() end)
And what happens is that it appears in the top left on load (this is in love.load and LoveFrames has been required as "lf" btw), and disappears when clicked / when anywhere else is clicked and never comes back.

What am I doing wrong / what do I need to do (besides have actual functions haha)?

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 » Sat Jan 17, 2015 3:40 am

Guard13007 wrote:Hi, I have been using LoveFrames in a couple different projects, and I recently wanted to make a menu object that you can open by right-clicking anywhere on screen. (I think I am understanding that is what the menu object is for?)

I have this currently:

Code: Select all

	local menu = lf.Create("menu")
	menu:AddOption("Email", false, function() end)
	menu:AddOption("Spreadsheets", false, function() end)
And what happens is that it appears in the top left on load (this is in love.load and LoveFrames has been required as "lf" btw), and disappears when clicked / when anywhere else is clicked and never comes back.

What am I doing wrong / what do I need to do (besides have actual functions haha)?
Try putting your menu code in the love.mousepressed callback:

Code: Select all

function love.mousepressed(x, y, button)
    if button == "r" then
        local menu = lf.Create("menu")
        menu:AddOption("Email", false, function() end)
        menu:AddOption("Spreadsheets", false, function() end)
    end
end

User avatar
Guard13007
Party member
Posts: 126
Joined: Sat Oct 25, 2014 3:42 am
Location: Internet, USA
Contact:

Re: Löve Frames - A GUI Library

Post by Guard13007 » Sun Jan 18, 2015 5:53 am

That + a call to set the position did exactly what I needed, thank you!

(Note to anyone who might be stumbling across this in the future, you need to create your menu in love.mousepressed() AFTER the called to loveframes.mousepressed() for it to work.)

Edit: Wait, actually, no, because I want it to only work when I am not hovering over another LoveFrames object...and it does.

Edit again: Figured it out (loveframes.util.GetHoverObject() is a savior).

Now my problem is that I want to make the close button make an object invisible instead of closing it.

Edit #3: And the docs have solved it again! Thank you for this amazing library + documentation that is clear and easy to navigate! (And I'm finally learning to consult the docs properly before asking for assistance haha.)

User avatar
Guard13007
Party member
Posts: 126
Joined: Sat Oct 25, 2014 3:42 am
Location: Internet, USA
Contact:

Re: Löve Frames - A GUI Library

Post by Guard13007 » Sun Jan 18, 2015 7:10 am

Question about the licensing on Love Frames:

On your website, it claims to be released under a CC BY 3.0 license.

In the repository, it claims to be released under the zlib/libpng license.

Which is it?

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 » Mon Jan 19, 2015 11:23 am

Guard13007 wrote:Question about the licensing on Love Frames:

On your website, it claims to be released under a CC BY 3.0 license.

In the repository, it claims to be released under the zlib/libpng license.

Which is it?
The current license is zlib/libpng.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests