How are you assigning the names of the objects?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
Löve Frames - A GUI Library
- Nikolai Resokav
- Party member
- Posts: 140
- Joined: Wed Apr 28, 2010 12:51 am
- Location: United States
Re: Löve Frames - A GUI Library
Re: Löve Frames - A GUI Library
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.
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.
- Nikolai Resokav
- Party member
- Posts: 140
- Joined: Wed Apr 28, 2010 12:51 am
- Location: United States
Re: Löve Frames - A GUI Library
That doesn't assign a name to the object itself, try doing something like this instead: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.
Code: Select all
local object = loveframes.Create("button")
object.name = "New Button"
Re: Löve Frames - A GUI Library
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!
I tried SetVisible(false) on the frame, but that hides the tooltip too. Any hints would be much appreciated!
- Nikolai Resokav
- Party member
- Posts: 140
- Joined: Wed Apr 28, 2010 12:51 am
- Location: United States
Re: Löve Frames - A GUI Library
You can make the objects invisible by setting a custom drawing function without any drawing code: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!
Code: Select all
local frame = loveframes.Create("frame")
frame.Draw = function() end
Re: Löve Frames - A GUI Library
That worked perfectly, thank you very muchNikolai Resokav wrote:You can make the objects invisible by setting a custom drawing function without any drawing code: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!
Code: Select all
local frame = loveframes.Create("frame") frame.Draw = function() end
Re: Löve Frames - A GUI Library
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.
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.
Seems that I can describe frames fonts and buttons fons through skins.
Re: Löve Frames - A GUI Library
-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
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
- Nikolai Resokav
- Party member
- Posts: 140
- Joined: Wed Apr 28, 2010 12:51 am
- Location: United States
Re: Löve Frames - A GUI Library
Make sure you are doing require("path.to.loveframes") and not require("path/to/loveframes").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
Re: Löve Frames - A GUI Library
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
-Edit -
forgot to do loveframes = require(blabla) fixed now
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'
forgot to do loveframes = require(blabla) fixed now
Who is online
Users browsing this forum: No registered users and 3 guests