LÖVE-Nuklear - a lightweight immediate mode GUI

Showcase your libraries, tools and other projects that help your fellow love users.
KayleMaster
Party member
Posts: 190
Joined: Mon Aug 29, 2016 8:51 am

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

Post by KayleMaster » 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.
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.

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

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

Post by grump » Wed Nov 08, 2017 2:50 pm

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

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

Post by KayleMaster » Wed Nov 08, 2017 5:45 pm

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

Post by Sinister Rectus » Wed Dec 06, 2017 1:44 am

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

Post by Ok23 » Thu Mar 01, 2018 11:33 pm

How to use nk.radio ?

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

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

Post by grump » Fri Mar 09, 2018 9:51 am

Code: Select all

selected = selected or { value = '1' }

nk.radio('1', selected)
nk.radio('2', selected)
nk.radio('3', selected)
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

Post by typx » 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.

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

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

Post by zorg » Fri Apr 06, 2018 5:26 pm

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 :3True 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.

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

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

Post by DekuJuice » Tue Apr 17, 2018 2:10 pm

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.

babakkarimiasl
Prole
Posts: 1
Joined: Tue May 01, 2018 12:59 pm

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

Post by babakkarimiasl » Tue May 01, 2018 4:00 pm

@DekuJuice thank you . saved my day . i had that white square problem with Nuklear . your workaround works for me . my OS : Lubuntu 16.04

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests