Skip to content
In-game console for Godot 3. New version coming, see dev branch.
GDScript
Branch: master
Clone or download
Pull request Compare This branch is even with QuentinCaffeino:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets/fonts/RobotoMono
docs
src
.gitignore
LICENSE.md
README.md
screenshot.png

README.md

Godot Console

In-game console for Godot, easily extensible with new commands.

There is a new version comming, help me debugging the dev branch.

Quake-style console for Godot

Features

  • Writing to console using write and writeLine method. You can use BB codes. (Also printed to engine output)

    Console.writeLine('Hello world!')

  • Auto-completion on TAB (complete command), Enter (complete and execute).

  • History (by default using with actions ui_up and ui_down)

  • Custom types (Filter, IntRange, FloatRange, and more...)

  • Logging

Installation

  1. Clone or download this repository to your project folder.
  2. Add src/Console.tscn to godot autoload as Console.
  3. Add new actions to Input Map: console_toggle, ui_up, ui_down

Example

Registering command:

func _ready():
	Console.register('sayHello', { # Command name

		'description': 'Prints hello world',

		'args': [ARGUMENT, ...],
			# This argument is obsolete if
			# target function doesn't
			# take any arguments

			# [Object, variable/method name]
		'target': [self, 'print_hello']
			# Target to bind command.
			# Providing name is obsolete
			# if command name is same.

	})

func print_hello():
	Console.writeLine('Hello world!')

ARGUMENT should look like this:

  • ['arg_name', ARG_TYPE]
  • 'arg_name' — In this situation type will be set to Any
  • ARG_TYPE

More information about ARG_TYPE you can find in this readme.

You can find more examples in src/BaseCommands.gd


Great thanks to @Krakean and @DmitriySalnikov for the motivation to keep improving the original console by @Calinou.

Take a look at their implementations.

License

Licensed under the MIT license, see LICENSE.md for more information.

You can’t perform that action at this time.