Seneral / Node_Editor_Framework

A flexible and modular Node Editor Framework for creating node based displays and editors in Unity
https://nodeeditor.seneral.dev
MIT License
2.01k stars 415 forks source link

Feature to change the background color of a Node #106

Closed gil-ferraz closed 7 years ago

gil-ferraz commented 7 years ago

Feature to change the background color of a Node via the SetBackgroundColor(Color color) method. This is useful to better differentiate between node types in complex systems.

Seneral commented 7 years ago

Thanks Gil, good idea! Theres a function called RTEditorGUI.ColorToTex which creates a texture from a color already. Maybe use that, instead of creating a new namespace, even if it's an extension:) Although I like your implementation better... Second note, cache the GUIStyle and create the texture only when needed, in SetBackgroundTexture. Creating that multiple times a frame would leak alot of memory;)

Seneral commented 7 years ago

So, fixed most of that myself. Are you ok with this?

Seneral commented 7 years ago

screenshot3

gil-ferraz commented 7 years ago

Hi! :) I'm glad you liked my suggestion. I am working on a custom Dailogue System for a project. I realized that I had way to many different Node types available and things were getting pretty chaotic on the editor side, so that's when I came up with the coloring idea. Sorry for not responding or edition the code with your suggestions sooner, but I have been very busy lately :/ I'm glad you were able to make the necessary corrections. The final feature looks pretty cool and well implemented :)

Seneral commented 7 years ago

No problem, and indeed, bigger canvases can get very messy:D I think this will help alot, thanks! If you've got any nice screens to share, don't hesitate to post them on the forums;)