- Clone the whole repository (
git clone git@github.com:WiggleWizard/godot-console.git
) intoproject-path/addons
. - Enable the addon by going to
Project -> Project Settings -> Plugins
and changing the status of theConsole
addon toActive
. - Drag
res://addons/godot-console/Console.tscn
into your 2D / GUI scene.
The Console automatically binds to the backtick key on your keyboard. Pressing ` will automatically bring up the console.
help
: Prints out all registered commands alongside their hints.
To register commands the register_command
function is available in a public space.
register_command(command_name, function_reference, hint, help_function_reference);
The console supports printing to, to do so you can use the log_raw()
function:
log_raw(string, bbcode=true);
Here's a print
example that will print to the console when using the print
command:
func _ready():
$Console.register_command("print", funcref(self, "_concmd_print"), "Prints to console");
func _concmd_print(argv):
$Console.log_raw(argv.join(" "));