0
votes

Working on an app that is quite UI intensive in Godot and it seems the wrap_lines option isn't working on the text edit nodes. it still scrolls horizontally as I type or if I set text it just does one long line. Is there a second option I need to change in the node

1

1 Answers

0
votes

I have a similar circumstance to your problem with my app and did my own custom solution. However, I am OK with just limiting the number of characters instead of wrapping the lines. My solution only covers limiting the line up to a certain number of characters. This is what I have for my solution:

func _on_TextArea1_text_changed():
    var temp = $TextArea1.text
    var maxTextSize = 9
    if temp.length() > maxTextSize:
        $TextArea1.text = temp.substr(0,maxTextSize)

Limitation: If I try to concatenate '\n' I get "Stack Overflow (Stack Size:1024)".

Resource: See https://docs.godotengine.org/en/stable/classes/class_textedit.html

Hope this helps.