## LÖVE-Nuklear - a lightweight immediate mode GUI

Tanner
Party member
Posts: 166
Joined: Tue Apr 10, 2012 1:51 am

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

No additional configuration was required for me on my platform.

Jack5500
Party member
Posts: 149
Joined: Wed Dec 07, 2011 8:38 pm
Location: Hamburg, Germany

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

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

Positive07
Party member
Posts: 1006
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

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

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/Positive07)

alberto_lara
Party member
Posts: 331
Joined: Wed Oct 30, 2013 8:59 pm

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

This is a huge work, I can definitely take some ideas from this and maybe apply them to GÖÖi, thanks for sharing!
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

Jack5500
Party member
Posts: 149
Joined: Wed Dec 07, 2011 8:38 pm
Location: Hamburg, Germany

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

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

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?

Jack5500
Party member
Posts: 149
Joined: Wed Dec 07, 2011 8:38 pm
Location: Hamburg, Germany

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

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: 602
Joined: Sat Jul 22, 2017 7:43 pm

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

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: 219
Joined: Mon Aug 29, 2016 8:51 am

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

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: 602
Joined: Sat Jul 22, 2017 7:43 pm

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

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?

### Who is online

Users browsing this forum: No registered users and 8 guests