Page 9 of 17

Re: ImGui löve module

Posted: Tue Aug 16, 2016 7:55 am
by Fenrir
OK guys I've made a new release with Image and ImageButton widgets support! You just need to pass a LOVE Texture object to it (so an Image or a Canvas):

Image

Code: Select all

require "imgui"

local image = love.graphics.newImage("test.png")

function love.update(dt)
    imgui.NewFrame()
end

function love.draw()
    love.graphics.clear(100, 100, 100, 255)

    imgui.Image(image, 400, 225)
    imgui.Render()
end

...
So now the bindings are quite complete I think for most usages, the only feature I would like to add is support for custom fonts, but it can definitely wait.

As always I've made pre-built binaries for Windows (32bit) and Linux, and a MacOSX version is still welcome if possible (I should soon get a Mac so it won't be a problem anymore).

Re: ImGui löve module

Posted: Tue Aug 16, 2016 7:57 am
by Jack5500
Great! Thanks a lot!

Re: ImGui löve module

Posted: Tue Aug 16, 2016 12:13 pm
by AnRu
Hi, i already have troubles with setting dock layout for panels. How to set panel DockStyle or something like this?

Re: ImGui löve module

Posted: Tue Aug 16, 2016 2:08 pm
by Ortimh
Wooho! Thanks a lot! Thanks for the support. And yeah, now it needs custom fonts, but as you say it can wait. Great job!

Re: ImGui löve module

Posted: Wed Aug 17, 2016 7:09 am
by Fenrir
AnRu wrote:Hi, i already have troubles with setting dock layout for panels. How to set panel DockStyle or something like this?
Not sure what you're looking for but you can probably control the docks style with the PushStyleColor/PopStyleColor and PushStyleVar/PopStyleVar functions.

Re: ImGui löve module

Posted: Wed Aug 17, 2016 2:12 pm
by AnRu
Fenrir wrote:
AnRu wrote:Hi, i already have troubles with setting dock layout for panels. How to set panel DockStyle or something like this?
Not sure what you're looking for but you can probably control the docks style with the PushStyleColor/PopStyleColor and PushStyleVar/PopStyleVar functions.
I mean dock placement, like Left, Top, RIght and Bottom :)

Re: ImGui löve module

Posted: Wed Aug 17, 2016 2:28 pm
by Fenrir
AnRu wrote:
Fenrir wrote:
AnRu wrote:Hi, i already have troubles with setting dock layout for panels. How to set panel DockStyle or something like this?
Not sure what you're looking for but you can probably control the docks style with the PushStyleColor/PopStyleColor and PushStyleVar/PopStyleVar functions.
I mean dock placement, like Left, Top, RIght and Bottom :)
You have a imgui.SetNextDock for that:
https://github.com/slages/love-imgui/bl ... gui_dock.h

The ImGuiDockSlot enum is binded to "Left", "Right", "Top", "Bottom", etc...

For instance:

Code: Select all

imgui.SetNextDock("Float")
imgui.BeginDock("MyDock")
...
imgui.EndDock()

Re: ImGui löve module

Posted: Wed Aug 17, 2016 4:56 pm
by AnRu
Fenrir wrote:
AnRu wrote:
Fenrir wrote:
Not sure what you're looking for but you can probably control the docks style with the PushStyleColor/PopStyleColor and PushStyleVar/PopStyleVar functions.
I mean dock placement, like Left, Top, RIght and Bottom :)
You have a imgui.SetNextDock for that:
https://github.com/slages/love-imgui/bl ... gui_dock.h

The ImGuiDockSlot enum is binded to "Left", "Right", "Top", "Bottom", etc...

For instance:

Code: Select all

imgui.SetNextDock("Float")
imgui.BeginDock("MyDock")
...
imgui.EndDock()
Thank you, I just didn't understand how enums are binded before
that :)

Re: ImGui löve module

Posted: Thu Aug 18, 2016 7:00 am
by Fenrir
AnRu wrote: Thank you, I just didn't understand how enums are binded before
that :)
Yep all enums are binded to their simple name without their type:
ImGuiWindowFlags_NoTitleBar => "NoTitleBar"
ImGuiCol_PlotLines => "PlotLines"
ImGuiDockSlot_Tab => "Tab"
...

You can find the full list at the end of this file:
https://github.com/slages/love-imgui/bl ... i_impl.cpp

Apart from that I can't stop anymore doing new debug windows for the game :)

Image

Re: ImGui löve module

Posted: Thu Aug 18, 2016 10:00 am
by AnRu
Fenrir wrote:
AnRu wrote: Thank you, I just didn't understand how enums are binded before
that :)
Yep all enums are binded to their simple name without their type:
ImGuiWindowFlags_NoTitleBar => "NoTitleBar"
ImGuiCol_PlotLines => "PlotLines"
ImGuiDockSlot_Tab => "Tab"
...

You can find the full list at the end of this file:
https://github.com/slages/love-imgui/bl ... i_impl.cpp

Apart from that I can't stop anymore doing new debug windows for the game :)

Image
Hey, can you please make an extra big example love file with most of usable features?
It's very difficult for someone to use as documentation from C++ headers, someone really don't know C++.
And big amount of examples will help to understand exactly Lua syntax for creating GUI