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

KayleMaster
Party member
Posts: 212
Joined: Mon Aug 29, 2016 8:51 am

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

Maybe compile is a better word?
I'm just trying to include the dll to my project via require.

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.

grump
Party member
Posts: 586
Joined: Sat Jul 22, 2017 7:43 pm

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

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"

KayleMaster
Party member
Posts: 212
Joined: Mon Aug 29, 2016 8:51 am

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

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.

Sinister Rectus
Prole
Posts: 1
Joined: Mon Apr 18, 2016 1:50 pm

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

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.

Ok23
Prole
Posts: 1
Joined: Thu Mar 01, 2018 11:31 pm

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

grump
Party member
Posts: 586
Joined: Sat Jul 22, 2017 7:43 pm

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

Code: Select all

selected = selected or { value = '1' }

nk.label(selected.value)

typx
Prole
Posts: 20
Joined: Fri Apr 06, 2018 1:26 pm

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

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.

zorg
Party member
Posts: 2730
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

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.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

DekuJuice
Prole
Posts: 14
Joined: Mon Nov 24, 2014 9:31 pm

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

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