Hi all,
Beginner at Godot here, I am sure you will notice. Really loving this engine so far!
Quick question, I am working on a console for my game, which I implemented as a TextEdit. What I want is:
To show the console as soon as the player starts typing (works) To show a prompt (>) on the first line when the player opens the console (works) To show a prompt (>) once the player presses enter after a command, on the new line (does not work)
This was my initial code, which sets the cursor before the prompt:
func _input(event):
if Input.is_key_pressed(KEY_ENTER):
insert_text_at_cursor(">")
And this is how I tried to fix it, which seems to just make a mess of things:
func _input(event):
if Input.is_key_pressed(KEY_ENTER):
insert_text_at_cursor("\n")
current_line += 1
cursor_set_line(current_line)
insert_text_at_cursor(">")
cursor_set_column(2)
Any thoughts?
The console is going to be a very important part of this game, so I am really focussing on getting this TextEdit thing figured out more.
Thanks!