ImGui LÖVE module

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: ImGui LÖVE module

Post by ArchAngel075 »

Ulydev wrote: Fri Sep 21, 2018 6:27 pm
ArchAngel075 wrote: Fri Sep 21, 2018 1:35 pm -
Had the same problem, did the same thing with setting a custom drag payload and checking whether the target area is hovered, it works but doesn't feel as good as using native ImGui's DragDrop* methods.
My grievances with custom payload handling is there is no clean method of saying 'what i just dropped onto is what mt target'
instead need to for each exact element do some chunk of code that does the isHovered test, not mouse.isDown() (released mouse over imgui element) and then setting that payload is now nil and no longer trigger any other tests (say elements beneath)

The other issue is using imgui to set what is the payloads visuals (say some Text, or image) - imgui.isItemHovered() on targets needs flags to ignore popups else the visual payload obstructs. its so gimicky and annoying. Also had to add some timeout to my payload test as testing the same frame or two of release seems to not work.
User avatar
GijsB
Party member
Posts: 380
Joined: Wed Jul 20, 2011 10:19 pm
Location: Netherlands

Re: ImGui LÖVE module

Post by GijsB »

I followed the 'Simple integration' on the repo but I'm getting this error ;

Code: Select all

Error

main.lua:18: bad argument #1 to 'NewFrame' (string expected, got table)


Traceback

[C]: in function 'NewFrame'
main.lua:18: in function 'update'
[C]: in function 'xpcall'
Which refers simply to :

Code: Select all

function love.update(dt)
    imgui.NewFrame()
end
I really have no idea what I'm doing wrong
gdinit
Prole
Posts: 3
Joined: Thu Feb 14, 2019 9:07 pm

Re: ImGui LÖVE module

Post by gdinit »

Fenrir wrote: Tue Jun 28, 2016 3:15 pm EDIT:
github project:
https://github.com/slages/love-imgui
...<snip>...
Fenrir,
Thank you very much for this project.


GijsB wrote: Fri Oct 26, 2018 8:27 am I followed the 'Simple integration' on the repo but I'm getting this error ;
...<snip>...
I really have no idea what I'm doing wrong
GijsB,
You're not doing anything wrong except probably your software is outdated.
For Win64, can you try using the binary (DLL) provided here and see if it helps?
https://github.com/slages/love-imgui/is ... -420133631

EDIT:
I have a question: is there a way to change font size at run time?
If I understand correctly lack of ImFont, ImFontAtlas ties our hands a bit, making "standard" ways of changing font at runtime unavailable to us. I can load (for test purposes) 80 fonts as follows:

Code: Select all

	for i=1,80 do
	    	imgui.SetGlobalFontFromFileTTF(ASSET_PATH_FONT_ARIAL, i)
		table.insert(fontSizes, i)
    		print("Loaded font size: "..i)
	end
I can confirm their successfully-loaded-status with: imgui.ShowFontSelector(".").
Picking a font from drop-down successfully changes active globalfont fine.

Likewise, this does have 'font -> list -> set as <fontentry> as default' button: imgui.ShowStyleEditor()
Picking a font with that button successfully changes active globalfont fine also.
I am looking for a way to do this without buttons/manual clicking though, programmatically from inside Lua code.
gdinit
Prole
Posts: 3
Joined: Thu Feb 14, 2019 9:07 pm

Re: ImGui LÖVE module

Post by gdinit »

After much googling, I couldn't make font change at runtime work with existing functions.
Well, if I am reading this correctly, it does exist in imgui but not in love-imgui hence the problem.

Anyhow, I have now added a small method myself (to imgui and love-imgui) which can be used as follows:
1) First, load a bunch of fonts/sizes and then
2) Switch between these at runtime.

It's late now but with a quick test, it seems to work. Shared on Github in a new issue & pull request.
Here is the link in case anyone else finds it useful: https://github.com/slages/love-imgui/issues/33
User avatar
Nedok
Prole
Posts: 2
Joined: Wed Feb 06, 2019 3:55 pm

Re: ImGui LÖVE module

Post by Nedok »

I do love ImGui LÖVE. However, I rely like to see it updated to ImGui v1.61 at least. This is because of some bugs related to column that exists in 1.53.

I have tried to update it myself, but lack the know how. Is there anyone that could give me some pointers on how to do this :3?
User avatar
Ikroth
Citizen
Posts: 79
Joined: Thu Jul 18, 2013 4:44 am

Re: ImGui LÖVE module

Post by Ikroth »

Hello everyone, I got an email notification a few days ago that my pull request to add automatic x64 build support has been merged. This means you should be able to find an "up to date" version of the DLL in the repository now. However, it's still only ImGui 1.53, but it means that future updates will have DLLs available right away. (https://github.com/slages/love-imgui/releases) I haven't had time to go back and add 32-bit support since I created that pull request, so it would be great if someone here is able to look into that. The current build only supports Windows 64-bit.
User avatar
yetneverdone
Party member
Posts: 448
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: ImGui LÖVE module

Post by yetneverdone »

Hi, in your gif docks work, however it does not work with the latest source code over on github.
User avatar
yetneverdone
Party member
Posts: 448
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: ImGui LÖVE module

Post by yetneverdone »

Hi, ive fixed the issue with the docks. The fix is in https://github.com/flamendless.love-imgui
tobiasvl
Prole
Posts: 29
Joined: Mon Oct 01, 2018 4:58 pm
Location: Norway
Contact:

Re: ImGui LÖVE module

Post by tobiasvl »

Hey! Sorry for the necro here, but I just noticed that although slages's repo has been silent for a good while, there's recently been some activity in these forks:

https://github.com/MikuAuahDark/love-imgui (imgui 1.73)
https://github.com/CoryNull/love-imgui (imgui 1.75)
https://github.com/Alloyed/love-imgui

It's exciting to see work being done on love-imgui, but it's almost getting too busy! Although Alloyed's fork actually lists what functions aren't implemented (a godsend!!), I'm not entirely sure what fork to follow now, or what differences there are between them.

There's also this LuaJIT implementation, perhaps it could be of use for love-imgui somehow? https://github.com/sonoro1234/LuaJIT-ImGui

Anyway! What I actually came here to ask: Is there a way to draw simple rectangles with love-imgui (any version)? All imgui examples I see involve manipulating the drawlist, functionality I don't entirely understand and which no version of love-imgui seems to support anyway.
sonoro
Prole
Posts: 1
Joined: Sun Aug 16, 2020 7:03 pm

Re: ImGui LÖVE module

Post by sonoro »

I am the author of https://github.com/sonoro1234/LuaJIT-ImGui (and also cimgui)

I have just added an imgui.love module and an example.

It supportss drawlists (It should support everything imgui has)
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests