+3 votes

I am trying to emulate the console from JKA;
Console from Jedi Knight: Jedi Academy

However I am unable to find any existing functionality to support this in existing nodes such as TextEdit or Label ( http://docs.godotengine.org/en/latest/classes/class_textedit.html )

I figure I could create a separate TextEdit and Label in order to get input using TextEdit and display the output using Label - making it appear like the console example above.

I am also looking for a way to make the text appear from bottom and move upwards instead of starting at the top.

The main purpose of the console is debugging - which later also can be used for various tasks such as changing key bindings, creating custom binds, and other stuff like Quake games use.

Opinions? Tips? :)

- Which node types are best to create a console window?
- How do I make text appear from the bottom and move upwards?

in Engine by (496 points)
edited by
What you wrote make sense to me, for output I would use RichtextLabel since it's easy to format text with it (or break the line). I would also add Animation player to control showing and hiding of the console, and generally you are good to go I guess? :)
Nice tip - I will look into animation in order to show/hide that when I get that far :)
I am checking out rich text label, as well as lineedit for input

1 Answer

+5 votes

I made something like this using RIchTextLabel for the console readout, and LineEdit for the input. With RichTextLabel you can use add_text() along with newline() to update the console. The nice thing about RichTextLabel is that it includes scrolling functionality. You can use set_scroll_follow(true) to make it always scroll to the most recent line, and push the previous lines upward.

by (24 points)
Problem with this is that I am unable to get text using that method (issue: https://github.com/godotengine/godot/issues/3903 )

Hoping to fix that :)
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.