Page 3 of 5

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

Posted: Mon Feb 06, 2017 3:06 pm
by Tanner
No additional configuration was required for me on my platform.

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

Posted: Tue Feb 07, 2017 6:24 am
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 :)

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

Posted: Tue Feb 07, 2017 7:30 am
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

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

Posted: Wed Feb 08, 2017 12:19 am
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!

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

Posted: Wed Feb 08, 2017 5:13 pm
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

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

Posted: Wed Feb 15, 2017 4:04 am
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?

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

Posted: Wed Feb 15, 2017 9:01 pm
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

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

Posted: Fri Nov 03, 2017 4:54 pm
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

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

Posted: Tue Nov 07, 2017 8:36 pm
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.

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

Posted: Wed Nov 08, 2017 10:54 am
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?