Dialogue System - Node TextArea + Styling

Solution: All in DialogueEditor.DrawNode()

  1. Enable GUI.skin.textField.wordWrap
  2. Use EditorGUILayout.TextArea (instead of TextField)
  3. Apply basic math to constrain the dynamic textArea size

Only need two lines of code, though I added some if/else so I can toggle between a field and area.

           GUI.skin.textField.wordWrap = true;
     
            node.SetText(EditorGUILayout.TextArea(node.GetText(),
                GUILayout.MaxHeight(node.GetRect().height - node.GetRect().height * .60f)));```

Capture


[original post]
Trying to figure out how to create a larger text area in the node, but not sure how to apply it to the exiting field so that the text wraps as intended.

Any help would be appreciated!

Image shown as example:

Capture

            node.SetText(EditorGUILayout.TextField(node.GetText(), GUILayout.MinHeight(60)));

2 Likes

Well done!!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms