ImGui LÖVE module

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

Jack5500 wrote:Good guess, that was the case.
Maybe you could add the 32bit text to the release? That would be nice
Good idea yes, I'll update it! :)
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

Hey guys,

So I added the extension for dockable windows and it works quite well:
Image

And it requires no modifications to imgui, it was just 2 files to add and create the corresponding bindings, so normally it won't prevent updating imgui to the latest versions in the future.

I updated the github project with a new release containg the docks and also the support for PlotLines and PlotHistogram widgets (quite useful for performance metrics). And I added an usage example of the docking capabilities in the github main page (it's the code creating what we can see on the gif).

Win32 and Linux builds are available for this v0.5 release, and of course I would be very grateful if someone can complete it with a MacOSX one! :)
User avatar
Ortimh
Citizen
Posts: 90
Joined: Tue Sep 09, 2014 5:07 am
Location: Indonesia

Re: ImGui löve module

Post by Ortimh »

Wow, thanks a lot. It's incredibly useful. By the way can I use Image from LOVE to ImGui's ImageButton?
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

Ortimh wrote:Wow, thanks a lot. It's incredibly useful. By the way can I use Image from LOVE to ImGui's ImageButton?
Nop that's one of the latest and biggest limitation of the current bindings, no support for images... It should not be too complex to add now that everything is relying on LOVE and not anymore on OpenGL or SDL calls, but I must admit that I have no use for it, so I won't be able to allocate time soon to work on it.

One possible workaround is just to retrieve a widget bounding box (with imgui.GetItemRectMin() and imgui.GetItemRectMax()), and render your image on top of it (so after the imgui.Render() call).
User avatar
AnRu
Citizen
Posts: 69
Joined: Sun Oct 27, 2013 1:33 pm
Contact:

Re: ImGui löve module

Post by AnRu »

Fenrir, thank you a lot for docking :)
User avatar
AnRu
Citizen
Posts: 69
Joined: Sun Oct 27, 2013 1:33 pm
Contact:

Re: ImGui löve module

Post by AnRu »

Is there a way to attach some love2d drawing stuff to window? For example i want to draw canvas over window, but i also need to do some interactions with it. So, events or something for windows?
User avatar
Ortimh
Citizen
Posts: 90
Joined: Tue Sep 09, 2014 5:07 am
Location: Indonesia

Re: ImGui löve module

Post by Ortimh »

Well I have read the ImGui Lua binding.. and it doesn't support images. Such a disappointment. But ImGui surely is the best for debugging and such.
AnRu wrote:Is there a way to attach some love2d drawing stuff to window? For example i want to draw canvas over window, but i also need to do some interactions with it. So, events or something for windows?
I think there's no way to combine ImGui and LOVE drawing stuff. It's not possible.
User avatar
Jack5500
Party member
Posts: 148
Joined: Wed Dec 07, 2011 8:38 pm
Location: Hamburg, Germany

Re: ImGui löve module

Post by Jack5500 »

I would like to raise my voice for image support as well, but none the less: Great work Fenrir. Couldn't you "attach" the window by storing the coordinates of where you draw your windows?
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

AnRu wrote:Is there a way to attach some love2d drawing stuff to window? For example i want to draw canvas over window, but i also need to do some interactions with it. So, events or something for windows?
Ortimh wrote:Well I have read the ImGui Lua binding.. and it doesn't support images. Such a disappointment. But ImGui surely is the best for debugging and such.

I think there's no way to combine ImGui and LOVE drawing stuff. It's not possible.
Hehe it's definitely not impossible, it just requires a bit of work with some custom bindings for it, as IMGUI wants a texture ID when it wants to draw an Image or ImageButton, and then it sends back this ID when requesting to draw this image. The best way to handle it would be to bind this ID to a LOVE Texture object to be able to draw canvas or regular images, then in the love-imgui plugin store this Texture object and create a ID for IMGUI, and finally when drawing it, get back the correct Texture from the ID we get and attach it to the Mesh object used for rendering. I'll try to find some time to work on it this week but I can't promise! :)

About the events, there's nothing directly into IMGUI, but it's not too complex, the way to go would just to check if your rendering canvas is currently hovered (imgui.IsItemHovered()). If yes, you retrieve you mouse coords and transform them into the canvas space (by retrieving the Item position and size with imgui.GetItemRectMin() and imgui.GetItemRectMax()) and you should be good to go.
User avatar
LordSeaworth
Prole
Posts: 22
Joined: Tue Jun 07, 2016 10:29 pm

Re: ImGui löve module

Post by LordSeaworth »

Hmm this seems very interresting.
Going to keep my eyes on this.

Could use his in my project.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests