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 »

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 »

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: 441
Joined: Fri Dec 27, 2013 4:53 pm

Re: Löve Frames - A GUI Library

Post by Doctory »

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 279 times
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 »

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: 441
Joined: Fri Dec 27, 2013 4:53 pm

Re: Löve Frames - A GUI Library

Post by Doctory »

thanks, it doesnt flicker now.
User avatar
Guard13007
Party member
Posts: 134
Joined: Sat Oct 25, 2014 3:42 am
Location: Internet, USA
Contact:

Re: Löve Frames - A GUI Library

Post by Guard13007 »

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 »

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: 134
Joined: Sat Oct 25, 2014 3:42 am
Location: Internet, USA
Contact:

Re: Löve Frames - A GUI Library

Post by Guard13007 »

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: 134
Joined: Sat Oct 25, 2014 3:42 am
Location: Internet, USA
Contact:

Re: Löve Frames - A GUI Library

Post by Guard13007 »

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 »

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 7 guests