Page 16 of 17

Re: ImGui LÖVE module

Posted: Wed Aug 16, 2017 10:04 pm
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:

Re: ImGui LÖVE module

Posted: Sat Aug 19, 2017 9:13 am
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

Re: ImGui LÖVE module

Posted: Sat Aug 19, 2017 2:46 pm
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"})

Re: ImGui LÖVE module

Posted: Mon Oct 09, 2017 7:26 am
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.

Re: ImGui LÖVE module

Posted: Sat Jun 23, 2018 10:52 am
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.

Re: ImGui LÖVE module

Posted: Sat Jun 23, 2018 3:22 pm
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.

Re: ImGui LÖVE module

Posted: Sat Jun 23, 2018 10:13 pm
by typx
Nice! Thanks alot :)

Re: ImGui LÖVE module

Posted: Tue Jun 26, 2018 7:57 am
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 23821 times

Re: ImGui LÖVE module

Posted: Fri Sep 21, 2018 1:35 pm
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.

Re: ImGui LÖVE module

Posted: Fri Sep 21, 2018 6:27 pm
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.