0 votes

I'm using a TextEdit box to add messages about what's happening during a game as per the function below. Is it possible to automatically scroll up when adding a new message at the end to ensure the last message is visible?

func add_message(msg):
  get_node("../MessageBox").insert_text_at_cursor(msg + "\n")
in Engine by (221 points)

1 Answer

0 votes

You can set the vertical_scroll to the line of text. You can find the line of text with a method in the TextEdit control. Look at the documentation for the textedit control

by (364 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.