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 414 forks source link

Add additional DisplayLayout overloads #13

Closed ritave closed 8 years ago

ritave commented 8 years ago

Now allows for the NodeKnob to be drawn using our own specified style instead of default one.

Example use case (I want the label be aligned to the knob I'm drawing):

public override void NodeGUI()
{               
    GUILayout.BeginHorizontal();

    GUILayout.BeginVertical();
    GUIStyle style = new GUIStyle(GUI.skin.label);
    style.alignment = TextAnchor.MiddleLeft;
    Inputs[0].DisplayLayout(style);
    GUILayout.EndVertical();
    GUILayout.BeginVertical();
    Outputs[0].DisplayLayout();
    GUILayout.EndVertical();

    GUILayout.EndHorizontal();
}