Defold GUI using Nuklear

Ive been working on a little side project that will hopefully display some live ISS telemetry onto a 3D ISS model:

Initially I used the excellent imgui native extension here:

Which I have successfully used in combo with DrawPixels and other extensions.

However this time I wanted some more complex 2D drawing and really wanted to use imgui’s draw lists. These work fine on desktops but they wouldnt work on Web asm (Im not certain of the reason).
I decided to look at some other possibilities and came across a very simple gui system (much like imgui) called Nuklear. Original is here:

With some quick tests, it seemed to do what I needed all within the one system. Additionally, the styling and theming is alot simpler too (mainly because it isnt as complex as imgui).
I built the native extension defold-nuklear:

I have added mouse wheel scroll, left and right click as well as mouse movement. I want to expose some more drawing and gui methods, but as it is atm it is quite usable.

Feel free to use and abuse it :slight_smile: … it is MIT license, so you are welcome to fork, download, or send me PR’s :wink:

A short video is below of the two of the four themes in the extension. The Future Tech theme, is very rudimentary, but it shows how you can expand a widget to do what you need.

18 Likes

This is cool! Thanks for sharing!

2 Likes

Updated isslive and the gui some more:

Might add a native extension for the lightstreamer protocol. This allows access to live finance trading data streams, and many other data servers. It uses the excellent websocket lib so could be useful to others.

5 Likes

Update: Added data charts for temperature on the three main modules.
More telemetry fixed.

Nuklear gui scaling and positioning fixed.
Various minor tweaks in the gui itself - added background space image too.
Overall fairly happy with the gui (esp across html and desktop).

4 Likes

Defold-Nuklear got some major updates over the last few weeks.

  • Added more widgets (combos, tab controls, selectables and more).
  • Added multi-font management. Now you can have as many fonts as you need.
  • More styling and theme improvements - will add a theme.lua for easy theming of nuklear.
  • Added window rescaling. However the mouse scaling is broken. Will fix.
  • Updated example to include most of the new widgets.
  • More improvements to image alpha. Fairly happy with this now.

Today Im going to make this much easier to integrate by having a nuklear.go that you can just add, and everything will just ‘work’ :slight_smile: (in theory).

9 Likes

Added a little theme editor. Will add load/save as well.

6 Likes

Load/Save added for theme styles
Also added text editing - backspace, delete and cursor movement.

3 Likes