LÖVE-Nuklear - a lightweight immediate mode GUI

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Tanner
Party member
Posts: 166
Joined: Tue Apr 10, 2012 1:51 am

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by Tanner »

No additional configuration was required for me on my platform.
User avatar
Jack5500
Party member
Posts: 148
Joined: Wed Dec 07, 2011 8:38 pm
Location: Hamburg, Germany

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by Jack5500 »

Well, I didn't get it to work fully, but so far I've documented my progress in the following issue.
https://github.com/keharriso/love-nuklear/issues/18

Still, if anybody has any more insight, into what lua libraries and headers are needed, feel free to comment :)
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by Positive07 »

Well I'm pretty sure LÖVE is not built with MinGW, and Visual Studio and MinGW linking system is not compatible.

To build I would install Visual Studio 2015 (Communityedition will do), then run a developer command prompt.

In that command prompt you can build LuaJIT 2.0.4 executing the included msvcbuild.bat in the LuaJIT src folder

Then you need to compile nuklear_love.c which is found in the love-nuklear/src folder, make sure that when you download love-nuklear it should also download the nuklear submodule. To compile nuklear_love.c you need to declare the include path in the command line so that the compiler can found lua.h and lauxlib.h which can be found in the LuaJIT src folder. The compile command is CL

You should now have an .obj folder which needs to be linked to to lua51.lib, which again can be found in the LuaJIT src folder. After you link you should have a nuklear.dll file (if it isnt called that then rename it). The linking command is LINK

This is the procedure I have followed with other libraries. Note that I haven't compiled love-nuklear myself, this is just my experience building other binary modules for Lua/LÖVE

Here is an example script

Code: Select all

luajit/src/msvcbuild.bat
cl /c /nologo /O2 /I"luajit/src" "love-nuklear/src/nuklear_love.c" /F"nuklear.obj"
link /nologo /dll /out:nuklear.dll "nuklear.obj" "luajit/src/lua51.lib"
The first command runs msvcbuild.bat which builds LuaJIT, the second compiles the love-nuklear object, and the last one links it against lua51.dll and outputs a dll
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by alberto_lara »

This is a huge work, I can definitely take some ideas from this and maybe apply them to GÖÖi, thanks for sharing!
User avatar
Jack5500
Party member
Posts: 148
Joined: Wed Dec 07, 2011 8:38 pm
Location: Hamburg, Germany

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by Jack5500 »

Positive07 wrote: In that command prompt you can build LuaJIT 2.0.4 executing the included msvcbuild.bat in the LuaJIT src folder
Thank you, adding a self compiled LuaJIT into the mix did the trick for me. I left a full explanation for any windows user here: https://github.com/keharriso/love-nuklear/issues/18
HumanRegret
Prole
Posts: 4
Joined: Mon Nov 09, 2015 12:44 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by HumanRegret »

Would someone Mind explaining how to use a button to increase a variable? basically i have this. https://hastebin.com/edasefakuy.lua with the GUI file looking like this, https://hastebin.com/rolifolife.lua .. I'm trying to use the "zoom in" button to increase the scale value in the Editor.lua .. How can this be done?
User avatar
Jack5500
Party member
Posts: 148
Joined: Wed Dec 07, 2011 8:38 pm
Location: Hamburg, Germany

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by Jack5500 »

HumanRegret wrote: Wed Feb 15, 2017 4:04 am Would someone Mind explaining how to use a button to increase a variable? basically i have this. https://hastebin.com/edasefakuy.lua with the GUI file looking like this, https://hastebin.com/rolifolife.lua .. I'm trying to use the "zoom in" button to increase the scale value in the Editor.lua .. How can this be done?
It's basically what you did over at line 55 in the rolifolife.lua.

Code: Select all

if nk.button('Zoom In') then
scaleValue = scaleValue + 1
end
Since you are working with two files here I would suggest to either make scaleValue global (bad) or make it an attribute of EditorGUI, so you can access it like

Code: Select all

EditorGUI.scaleValue = EditorGUI.scaleValue + 1
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by grump »

Does anyone know how to programmatically collapse a manually expanded tree tab? The user has clicked on the tab to expand it, and later I want to collapse it by program logic. It seems only possible to set the initial state, but not to change it later.

Code: Select all

if nk.treePush("tab", "Tab", nil, "collapsed") then
    -- this tree is now expanded. What code do I put here to collapse it again?
    nk.treePop()
end
KayleMaster
Party member
Posts: 234
Joined: Mon Aug 29, 2016 8:51 am

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by KayleMaster »

How do I get this running?

It says it can't find the package. However, this only happens if I build with Visual Code. If I build with Sublime it builds fine with no errors?
I'd much rather use Visual Code. Any tips?

UPDATE: It runs fine if I build from VSCODE but put the DLL in the LOVE install directory.. This will work for now, but I need a solution.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: LÖVE-Nuklear - a lightweight immediate mode GUI

Post by grump »

KayleMaster wrote: Tue Nov 07, 2017 8:36 pm It says it can't find the package. However, this only happens if I build with Visual Code. If I build with Sublime it builds fine with no errors?
Who says that? Lua? What build errors do you get?
UPDATE: It runs fine if I build from VSCODE but put the DLL in the LOVE install directory.. This will work for now, but I need a solution.
Can you post the error messages you're getting?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests