Nuklear icon indicating copy to clipboard operation
Nuklear copied to clipboard

Node editor demo expanded

Open hwps opened this issue 1 year ago • 9 comments

This PR expands on the node editor demo to make it a functional example of a node-based UI.

Features:

  • multiple node types
  • multiple connector types
  • linking between connectors of the same type
  • detaching and reattaching links
  • getting value from linked node if slot is connected

node_editor

Some notes:

  • only tested with the glfw_opengl3 backend
  • uses system malloc, not sure if nk_malloc should be preferred.
  • uses the standard panel close button , then checks for NK_WINDOW_HIDDEN whether to delete a node or display it. Not sure if there's some pitfall here.

hwps avatar Jun 02 '23 10:06 hwps

Nice stuff

leobenaducci avatar Jun 02 '23 11:06 leobenaducci

I like where this is going. I'm not sure what's wrong with the demo though? This is the sdl_renderer.... Screenshot at 2023-09-12 03-25-01

RobLoach avatar Sep 12 '23 07:09 RobLoach

@RobLoach Can you click the connectors to draw a link or right click to add nodes?

Maybe there should be some more nodes or at least links in the initial state. I realize now that for someone not used to a node-based UI it might be non-obvious what to do.

hwps avatar Sep 15 '23 13:09 hwps

Ok, finally did this slight update to the init state. Screenshot attached.

Screenshot 2023-12-11 at 19 44 53

hwps avatar Dec 11 '23 17:12 hwps

Nice work! I ran it on glfw_opengl3 and x11_xft demos (screenshot for the later below)

x11_xft

riri avatar Dec 11 '23 21:12 riri