Page 4 of 7

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

Posted: Wed Nov 08, 2017 2:20 pm
by KayleMaster
Maybe compile is a better word?
I'm just trying to include the dll to my project via require.
Image
Same thing if the dll is in the same folder as main.lua.
Only works if the dll is in C:\Program Files\LOVE (love's install directory) but that means I can't distribute my game.

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

Posted: Wed Nov 08, 2017 2:50 pm
by grump
KayleMaster wrote: Wed Nov 08, 2017 2:20 pm Maybe compile is a better word?
I'm just trying to include the dll to my project via require.
I'm confused. So, the DLL compiles just fine? Is this about build errors or runtime errors?

Anyway, if you require the DLL like this

Code: Select all

local nk = require("libraries.nuklear")
Lua will look for a function name luaopen_libraries_nuklear to initialize the lib. This will fail, unless you renamed luaopen_nuklear in the source code.

Try this:

Code: Select all

local lib, errmsg = package.loadlib("./libraries/nuklear.dll", "luaopen_nuklear")
assert(lib, errmsg)
local nk = lib()
You should also make sure that the working directory is the directory where your main.lua resides, not the directory where love.exe is located. I don't know about Visual Studio Code, but standard Visual Studio has project settings for this.

If you can't fix it that way, use this as the lib path:

Code: Select all

love.filesystem.getSource() .. "/libraries/nuklear.dll"

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

Posted: Wed Nov 08, 2017 5:45 pm
by KayleMaster
Thanks, this works:
local lib, errmsg = package.loadlib(love.filesystem.getSource() .. "./libraries/nuklear.dll", "luaopen_nuklear")
assert(lib, errmsg)
local nk = lib()

I'll keep the assert just in case for now.

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

Posted: Wed Dec 06, 2017 1:44 am
by Sinister Rectus
Several months, ago, I started writing an object-oriented wrapper for love-nuklear. I named it "fuzion" as a play on "nuklear". I stopped working on it, though, due to running into a lot of bugs. I don't know if they are in the Lua library or in the core C library.

I recently unearthed my work and decided to put it on GitHub. I don't know if I'll continue working on it, since I don't really have a need to. It was more of a proof of concept, and not worth continue as long as these bugs exist, imo.

Repo: https://github.com/SinisterRectus/fuzion

Summary of the bugs that I have found:
- "static" mode fails for spaces
- line-wrap not working for dynamic rows
- the state value on checkboxes is backwards
- combobox out-of-bounds values are not caught
- 100% displays off the screen for progress bars
- "inc" doesn't seem to have any affect on properties
- left align cuts through images on selectables
- the logical cursor does not match the gui cursor on sliders

These are based on notes I took a few months ago, so I don't have detail for each bug explanations at the moment.

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

Posted: Thu Mar 01, 2018 11:33 pm
by Ok23
How to use nk.radio ?

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

Posted: Fri Mar 09, 2018 9:51 am
by grump

Code: Select all

selected = selected or { value = '1' }

nk.radio('1', selected)
nk.radio('2', selected)
nk.radio('3', selected)
nk.label(selected.value)

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

Posted: Fri Apr 06, 2018 1:53 pm
by typx
Is this still working in 11.0?
I'm super new to Lua and Löve, so I've tried running the example code and all I get is a white square.

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

Posted: Fri Apr 06, 2018 5:26 pm
by zorg
typx wrote: Fri Apr 06, 2018 1:53 pm Is this still working in 11.0?
I'm super new to Lua and Löve, so I've tried running the example code and all I get is a white square.
Hi and welcome to the forums.

The first release of 11.0 has an issue with canvases not exactly working, so that may be the most noticeable issue; devs are aware and i think they already fixed it, but the fix only exists in a nightly for now, if i recall correctly.

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

Posted: Tue Apr 17, 2018 2:10 pm
by DekuJuice
The white square is because nuklear hasn't been updated for 11.0's 0-1 color range yet.
Nuklear calls the setColor function from lua though, so a temporary fix is to drop

Code: Select all

local old_set_color = love.graphics.setColor
function love.graphics.setColor(r,g,b,a)
    a = a or 255
    old_set_color(r/255, g/255, b/255, a/255)
end
somewhere in your code.

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

Posted: Tue May 01, 2018 4:00 pm
by babakkarimiasl
@DekuJuice thank you . saved my day . i had that white square problem with Nuklear . your workaround works for me . my OS : Lubuntu 16.04