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 » Fri Dec 12, 2014 8:08 pm

fmra wrote:I'm trying to retrieve the name of an object using GetHoverObject, but having iterated through the table it returns, the names I gave the objects do not exist. Closest I get is "instance of class loveframes_object_imagebutton" or similar. I'm trying to retrieve the name to match it against a table value (the objects name). See "obj[x]"

Code: Select all

if loveframes.util.GetHoverObject() then
  obj = loveframes.util.GetHoverObject()
  for k, v in ipairs(tbl) do
    if obj[x] == v then
      ...
    end
  end
end
How are you assigning the names of the objects?

fmra
Prole
Posts: 9
Joined: Fri Nov 29, 2013 9:39 pm

Re: Löve Frames - A GUI Library

Post by fmra » Fri Dec 12, 2014 8:27 pm

oObjectName = loveframes.Create("___")

Since the objects are all created by the time it checks and are all listed in the table I'm referencing by these names, I thought it should work.

I'm hoping to be able to compare the string name for the object, retrieved by :GetHoverObject(), and the string name saved in my table.

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 » Sun Dec 14, 2014 12:52 am

fmra wrote:oObjectName = loveframes.Create("___")

Since the objects are all created by the time it checks and are all listed in the table I'm referencing by these names, I thought it should work.

I'm hoping to be able to compare the string name for the object, retrieved by :GetHoverObject(), and the string name saved in my table.
That doesn't assign a name to the object itself, try doing something like this instead:

Code: Select all

local object = loveframes.Create("button")
object.name = "New Button"

Piggles
Prole
Posts: 10
Joined: Wed Dec 22, 2010 6:08 pm

Re: Löve Frames - A GUI Library

Post by Piggles » Sun Dec 14, 2014 8:29 pm

Really awesome library, thanks for your hard work. I'm wondering if there is a way to add a tooltip to an arbitrary area of the screen? Basically I have a grid of images and I would like to add a tooltip to each one, but I can't seem to do it without covering the image with a parent frame:

Image Image

I tried SetVisible(false) on the frame, but that hides the tooltip too. Any hints would be much appreciated!

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 » Sun Dec 14, 2014 8:50 pm

Piggles wrote:Really awesome library, thanks for your hard work. I'm wondering if there is a way to add a tooltip to an arbitrary area of the screen? Basically I have a grid of images and I would like to add a tooltip to each one, but I can't seem to do it without covering the image with a parent frame:

Image Image

I tried SetVisible(false) on the frame, but that hides the tooltip too. Any hints would be much appreciated!
You can make the objects invisible by setting a custom drawing function without any drawing code:

Code: Select all

local frame = loveframes.Create("frame")
frame.Draw = function() end

Piggles
Prole
Posts: 10
Joined: Wed Dec 22, 2010 6:08 pm

Re: Löve Frames - A GUI Library

Post by Piggles » Sun Dec 14, 2014 9:05 pm

Nikolai Resokav wrote:
Piggles wrote:Really awesome library, thanks for your hard work. I'm wondering if there is a way to add a tooltip to an arbitrary area of the screen? Basically I have a grid of images and I would like to add a tooltip to each one, but I can't seem to do it without covering the image with a parent frame:

I tried SetVisible(false) on the frame, but that hides the tooltip too. Any hints would be much appreciated!
You can make the objects invisible by setting a custom drawing function without any drawing code:

Code: Select all

local frame = loveframes.Create("frame")
frame.Draw = function() end
That worked perfectly, thank you very much :)

Muris
Party member
Posts: 131
Joined: Fri May 23, 2014 9:18 am

Re: Löve Frames - A GUI Library

Post by Muris » Tue Dec 16, 2014 2:53 pm

I tried to use the gui for android, and it seems to work pretty well after setting love.setTextInput(true) when textinputfield gains focus, to get the virtual keyboard up, and then set it to false after clicking enter.

The problem that I noticed, I guess you could kind of call it a feature is with buttons. With Android since there is no visible cursor so the button needs to be clicked twice. First click is to set it as "hovered" -state because thats when the mousecursor moves from last spot, and second click to actually accept the click. I could be wrong with my analyzing, didn't look too deeply in the code, but from visual appearance thats what I think is happening. Also dragging finger across the screen to on top of the button to set the mouse coordinates on top of it first and then clicking it once seems to work instead of having to double click, so I suppose this further proves that the culpirit is the hovering feature.

Another issue that I noticed, or more likely just missed something in docs, is that frames text size cannot be changed.
Seems that I can describe frames fonts and buttons fons through skins.

vekenti
Prole
Posts: 4
Joined: Mon Dec 22, 2014 4:37 am

Re: Löve Frames - A GUI Library

Post by vekenti » Mon Dec 22, 2014 7:28 pm

-Edit-

Does this not work with Love 0.91? it gives me some attempted to call 'NewObject'(a nil value) error coming from loveframes/objects/base

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 Dec 22, 2014 10:03 pm

vekenti wrote:-Edit-

Does this not work with Love 0.91? it gives me some attempted to call 'NewObject'(a nil value) error coming from loveframes/objects/base
Make sure you are doing require("path.to.loveframes") and not require("path/to/loveframes").

vekenti
Prole
Posts: 4
Joined: Mon Dec 22, 2014 4:37 am

Re: Löve Frames - A GUI Library

Post by vekenti » Mon Dec 22, 2014 10:18 pm

Make sure you are doing require("path.to.loveframes") and not require("path/to/loveframes").[/quote]

Wow didnt know that would make a difference o.o thanks

-Edit- Got a different error now,says that

Code: Select all

attempt to index global 'loveframes' (a nil value)
in function 'load'
-Edit -

forgot to do loveframes = require(blabla) fixed now

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests