Are there any existing nodes or functionality in order to create an in-game console?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Tybobobo
:warning: Old Version Published before Godot 3 was released.

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? :slight_smile:

TLDL;

  • Which node types are best to create a console window?

  • How do I make text appear from the bottom and move upwards?

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? :slight_smile:

kubecz3k | 2016-03-02 09:38

Nice tip - I will look into animation in order to show/hide that when I get that far :slight_smile:
I am checking out rich text label, as well as lineedit for input

Tybobobo | 2016-03-02 09:41

:bust_in_silhouette: Reply From: Myrkrel

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.

Problem with this is that I am unable to get text using that method (issue: RichTextLabel missing get_text() to return string · Issue #3903 · godotengine/godot · GitHub )

Hoping to fix that :slight_smile:

Tybobobo | 2016-03-02 23:34