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 »

OK guys I've made a new release (https://github.com/slages/love-imgui/releases/tag/0.7) with the last fixes and improvements, and I added some hand made bindings for overrided functions like imgui.Value, instead of using imgui.Value_2, imgui.Value_3, etc... Just use imgui.Value and it will select the best override depending on what you send to it, for instance:

Code: Select all

imgui.Value("Bool", true)
imgui.Value("Number", 56)
I tried to automatize the process but it wasn't able to find a proper solution for it, so I added those bindings manually:
"Value"
"ValueColor"
"CollapsingHeader"
"TreeNodeEx"
"TreeNode"
"Combo"
"RadioButton"
"PushID"
"GetID"
"PushStyleVar"
"SetWindowPos"
"SetWindowSize"
"SetWindowCollapsed"
"SetWindowFocus"
"BeginChild"
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: ImGui löve module

Post by s-ol »

Any chance of getting InputText to work? It requires a callback for updating the state I think (Or does it modify the buffer? if so, it should return the updated string as 2nd argument, too, like windows with "close" buttons do).

EDIT: nevermind. it's working wonderfully, I just accidentally set the buffer size to 0.

Just to show off, here's are my debug tools atm:
Image

The console is working great, I basically copied it from the imgui_demo.cpp example.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

Really nice, I'll add it to the first post galery! :) Glad to hear it about the console, I'll probably use it in my project too, and I'll soon implement the log window too, it's something I desperately need for a long time.
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

I added my long awaited log window! :)

Image

Actually on imgui side it's really simple:

Code: Select all

imgui.SetNextWindowSize(500,400, "FirstUseEver")
status, draw = imgui.Begin("Log", true)
if imgui.Button("Clear") then
    self._messagesBuffer = ""
    self._messageLines = 0
end
imgui.SameLine()
status, self._displaySeverity = imgui.Combo("Severity", self._displaySeverity, severityStrings, #severityStrings)
imgui.Separator()
imgui.BeginChild("scrolling", 0, 0, true, "HorizontalScrollbar")
imgui.TextUnformatted(self._messagesBuffer)
if self._scrollToBottom then
    imgui.SetScrollHere(1.0)
end
self._scrollToBottom = false
imgui.EndChild()
imgui.End()
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: ImGui löve module

Post by s-ol »

Fenrir wrote:I added my long awaited log window! :)

Actually on imgui side it's really simple:

Code: Select all

imgui.SetNextWindowSize(500,400, "FirstUseEver")
status, draw = imgui.Begin("Log", true)
if imgui.Button("Clear") then
    self._messagesBuffer = ""
    self._messageLines = 0
end
imgui.SameLine()
status, self._displaySeverity = imgui.Combo("Severity", self._displaySeverity, severityStrings, #severityStrings)
imgui.Separator()
imgui.BeginChild("scrolling", 0, 0, true, "HorizontalScrollbar")
imgui.TextUnformatted(self._messagesBuffer)
if self._scrollToBottom then
    imgui.SetScrollHere(1.0)
end
self._scrollToBottom = false
imgui.EndChild()
imgui.End()
Now add a REPL!

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
RamiLego4Game
Citizen
Posts: 73
Joined: Tue Jun 10, 2014 7:41 pm

Re: ImGui löve module

Post by RamiLego4Game »

Just wondering, How can I create a multiline textbox with Lua syntax highlight..
Edit: Also, Why not adding this library to the wiki ??
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

RamiLego4Game wrote:Just wondering, How can I create a multiline textbox with Lua syntax highlight..
Edit: Also, Why not adding this library to the wiki ??
Unfortunately there's nothing out of the box to get colored text in a multiline input box, but I found this thread talking about it:
https://github.com/ocornut/imgui/issues/200
So it seems to be part of the todolist, but not sure when he will tackle it.

And yes, we should add it to the wiki, I'll have a look into 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,

Just to let you know that I finally got my hands on a Mac, so I added to the pre-built binaries the MacOS X version of the module, I tested it quite a bit and it works just fine (it took me some time to figure out where to put it to get it properly loaded, first time that I use a Mac, hehe...).
User avatar
EntranceJew
Prole
Posts: 31
Joined: Fri Apr 03, 2015 10:02 pm
Location: Saint Petersburg, Florida
Contact:

Re: ImGui löve module

Post by EntranceJew »

Is there any reason you're not producing win64 builds? It's a real bummer to have to downgrade my LÖVE version (or to build my own constantly) for this to work. Requiring the module was causing a right fit with the 64bit version of LÖVE. (One of the small pains that makes me long for luasec to ship with LÖVE.)

Also, having the dll anywhere but the root of my project (right next to main.lua) seems to raise this error. I would really prefer to not have to have this dll next to the love executable / my main.lua file.
sandsmas: A LÖVE Editor
My Libraries: Imgur, Palettes, Music Macros, Timer, Hooks
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

EntranceJew wrote:Is there any reason you're not producing win64 builds? It's a real bummer to have to downgrade my LÖVE version (or to build my own constantly) for this to work. Requiring the module was causing a right fit with the 64bit version of LÖVE. (One of the small pains that makes me long for luasec to ship with LÖVE.)

Also, having the dll anywhere but the root of my project (right next to main.lua) seems to raise this error. I would really prefer to not have to have this dll next to the love executable / my main.lua file.
I'll have a look into providing a x64 version! It's just that I've no use for it on my side, but I'll try to find a bit of time to create it.

And yes you can move it somewhere else, you just need to update your cpath for it, here's for instance what I'm doing on my side to select the appropriate version depending on the current OS:

Code: Select all

local cpath = love.filesystem.getSourceBaseDirectory() .. "/plugins/" .. love.system.getOS()
package.cpath = package.cpath .. ";" .. cpath .. "/?.so" .. ";" .. cpath .. "/?.dll"
pcall(function() require "imgui" end)
So inside my plugin directory I have 3 folders: "Linux", "OS X" and "Windows" with all my binary modules for each platforms.
Post Reply

Who is online

Users browsing this forum: No registered users and 56 guests