ImGui LÖVE module

Showcase your libraries, tools and other projects that help your fellow love users.
dan369
Prole
Posts: 44
Joined: Tue Apr 15, 2014 10:53 pm

Re: ImGui LÖVE module

Post by dan369 »

alloyed wrote: Tue Aug 15, 2017 12:32 am
dan369 wrote: Mon Aug 14, 2017 6:19 pm Does anyone know how to capture the button press against the 'X' (i.e. to close the window)? I've been looking into the docs and see that p_open is the second parameter in imgui.Begin() but it when i click it in my code it doesn't seem to have any effect/change the boolean value.
This is in the one place in my code where I use this feature

Code: Select all

local isVisible, isOpen = imgui.Begin(windowID, true, flags)
if isOpen == false then
    -- don't run this block next time
end
imgui.End()
afaik this is an automatically generated change. The C++ api uses that second argument as a reference parameter, but those don't exist in lua so they get tacked on to the list of return arguments instead. This also applies to things like the text fields iirc.
Thanks @alloyed, that worked perfectly :awesome:
User avatar
milk
Prole
Posts: 39
Joined: Sun Jul 17, 2016 7:20 pm

Re: ImGui LÖVE module

Post by milk »

Does someone know how to add flags to textInputs, specifically the password flags for textInputs;

Code: Select all

 ImGui::InputText("password", bufpass, 64, ImGuiInputTextFlags_Password | ImGuiInputTextFlags_CharsNoBlank);
Which I turn into

Code: Select all

imgui.inputText("password", passwordVar ... -- And the rest I don't know
User avatar
Valden
Prole
Posts: 1
Joined: Sat Aug 19, 2017 2:36 pm

Re: ImGui LÖVE module

Post by Valden »

You pass flags to Imgui by putting them as individual strings in a table and removing the part preceding the underscore. So in your case that would give :

Code: Select all

imgui.inputText("password", passwordVar, 64, {"Password", "CharsNoBlank"})
User avatar
portify
Prole
Posts: 18
Joined: Sun Feb 15, 2015 10:15 pm
Location: Locating
Contact:

Re: ImGui LÖVE module

Post by portify »

How do I set the WindowTitleAlign style? I'd like to persist the window title centering I have set here using the style editor:

Image

I'm currently using PushStyleVar/PushStyleColor for all my styling (since GetStyle isn't available), but trying to set WindowTitleAlign using PushStyleVar_2 just hits the assert in imgui for when the style variable is of the wrong type.
typx
Prole
Posts: 20
Joined: Fri Apr 06, 2018 1:26 pm

Re: ImGui LÖVE module

Post by typx »

Are there any Love 11.1 binaries out there? For some reason, I'm unable to finish the build process. Cloning and CMake work fine but nmake can't find a makefile and opening the project in VS spits out a lot of errors when trying to compile.
User avatar
Ikroth
Citizen
Posts: 79
Joined: Thu Jul 18, 2013 4:44 am

Re: ImGui LÖVE module

Post by Ikroth »

typx wrote: Sat Jun 23, 2018 10:52 am Are there any Love 11.1 binaries out there? For some reason, I'm unable to finish the build process. Cloning and CMake work fine but nmake can't find a makefile and opening the project in VS spits out a lot of errors when trying to compile.
You're in luck! I just went through the whole process of getting it setup to build automatically on Windows, see if this works for you: https://github.com/camchenry/love-imgui ... ter-latest. It's currently just a Windows x86_64 only, no 32-bit support yet. I'll probably clean up what I have and submit a pull request to the original repo.
typx
Prole
Posts: 20
Joined: Fri Apr 06, 2018 1:26 pm

Re: ImGui LÖVE module

Post by typx »

Nice! Thanks alot :)
typx
Prole
Posts: 20
Joined: Fri Apr 06, 2018 1:26 pm

Re: ImGui LÖVE module

Post by typx »

I'm making use of imgui.SetGlobalFontFromFileTTF("gfx/JAi.ttf", 14) which is working fine when running in ZeroBrane Studio. Sadly, as soon as I make an .exe file and run it, it ignores the font and uses the default one. How could I change this behaviour?
imgui_font.jpg
imgui_font.jpg (13.3 KiB) Viewed 25274 times
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: ImGui LÖVE module

Post by ArchAngel075 »

Having issues using DragDrop*** methods.

Consider the following code after a usual imgui.Begin() :

Code: Select all

    local active = imgui.Selectable("Test DropableItem");
    if (imgui.BeginDragDropSource()) then
        imgui.Text("dropping this")
        -- imgui.SetDragDropPayload("Item", {item_id = "MyItem#ABCDEF-ABCDEF"})
        imgui.EndDragDropSource()
    end

    local active = imgui.Selectable("Test Target");
    local payload = imgui.BeginDragDropTarget();
    if payload then
        print("DropSource")
        print(payload)
            -- local payload = imgui.AcceptDragDropPayload("Item");
        imgui.EndDragDropTarget()
    end
the methods
  • AcceptDragDropPayload
  • SetDragDropPayload
are all nil. I did a search in the imgui table and those methods indeed do not exist.

Did a search in src folder of github and found in here
the method is commented out along with "Unsupported return type const"

Is LOVE2D-imgui unable to support fully drag drop of items (not files externally) and/or is there some way i can detect the drop?

atm im considering setting a bool on Drag (since that happens) and checking if wasDragging on mouse release capturing mouse. then after targets doing

Code: Select all

if isItemHovered() and _wasDragging then
 --payload handling here
end
id prefer some more imgui method here.
User avatar
Ulydev
Party member
Posts: 445
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: ImGui LÖVE module

Post by Ulydev »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests