LibGDX In-Game Console

This is a libGDX library that allows a developer to add a console (similar to how it is featured in Source games) to their game.
Essentially what the console allows you to do is specify commands that you will be able to access from within the game, using the console. The console also enables live logging from within the application.

GitHub

Example:

4N4W4zs.png

VERSIONS

Latest Stable: 1.0.0
Latest Snapshot: **

CHANGELOG

1.0.0

Includes changes from both 1.0.0 snapshots, as well as those below.

Features

  • Added getter to get Console's window

Fixes

  • Updated to libGDX 1.9.9
  • Fixed up arrow not being able to spam up-enter to repeat the previous command

1.0.0b-SNAPSHOT

Fixes

  • The console should now be fully VisUI compatible

1.0.0-SNAPSHOT

Features

  • Added the option to specify superclasses for all UI components
    • This means you can use VisUI and make all Console components be subclasses of their VisUI counterparts!

0.9.0

Features

  • Added an optional 'Submit' button that can be used to execute commands instead of the enter key
    • Use enableSubmitButton to enable/disable the button and setSubmitText to change the text that is shown on the button

Fixes

  • Made some classes that weren't public, public, to help with accessibility
  • Changed exception logging to use Throwables

0.8.1

Fixes

  • CommandExecutor is no longer abstract, to help with intuitiveness for newcomers #36

0.8.0

Features

  • Setting the console window's title is now possible #35
  • Added hoverColor and noHoverColor properties (and related setters) which specify the color to show when the console has the cursor hovering over it or not, respectively #34
  • Log entries are now highlighted when hovered over and can be clicked on to open a context menu
    • Context menu allows copying of log entries

Fixes

  • Updated to libGDX 1.9.8

0.7.1

Fixes

  • Fixed issue #27 (console would not show again after hiding)

0.7.0

Features

  • Added ConsoleDoc annotation which allows you to give function and parameter descriptions that show up when you run 'help <cmd>'
  • Added select() function so that you can programmatically re-select the console after deselect()
  • CommandExecutor can now be subclassed infinitely and help will show all available commands (used to be only 1 level)

0.6.0

Features

  • Added ability to set a console font (create a BitmapFont style in your skin called 'console-font')
  • Added ability to enter 'logView', which deselects the console text field and allows you to use your keyboard while the console is open (reselect the text field just by clicking on it)

0.5.3

Fixes

  • Updated to libGDX 1.9.6
  • Maven now generates sources for GWT Jitpack support
  • Changed default display key to ' (apostrophe) for web compatibility
  • setConsoleTrace(boolean) enables/disables printing the stack trace to the console when an error occurs on executing a command
  • The "help" command now also prints the base CommandExecutor functions

0.5.2

Fixes

  • Changed get/setKeyID() to get/setDisplayKeyID()
  • Added setVisible() command to Console
  • Changed all 'Hidden' commands to 'Visible' to keep with proper conventions

0.5.1

Fixes

  • Fixed issue #20 (crash when using libGDX 1.9.4)

0.5.0

Features
Major thanks again to ThaBalla1148

  • Implemented HiddenCommand annotation for CommandExecutor methods
    • Using this annotation allows commands to either be hidden from help command and auto-complete or disabled from being executable. Supports both simultaneously.
    • By default, hidden commands are executable, but are hidden from displaying.
  • Refactored and updated method and argument determination/parsing code
    • Now supports String, Boolean, Byte, Short, Integer, Long, Float, Double, and their primitive counter-parts.

Fixes

  • Fixed commands still being executable when console was disabled

0.4.0

Features
Major thanks to ThaBalla1148

  • Added GUIConsole - Graphical User-Interface Console replaces original Console.
  • Added HeadlessConsole - Used for servers, has no dependency on graphics or inputs.
  • Added AbstractConsole - Contains common code shared by GUIConsole and HeadlessConsole.
  • Extracted LogLevel - To stay Java 7 compliant, this was removed from Console.
  • Updated ConsoleExecutor#help - Now produces a separate log for each method, looks better when displaying to System.out.
  • Updated Box2DTest - Uses GUIConsole for test.
  • Updated to use LibGdx 1.9.3

0.3.3

Fixes

  • Fixed occasional illegalAccessException errors when executing methods.
  • Updated to LibGdx 1.9.2
  • Made execCommand() public to allow for executing commands at startup, from file.

0.3.2

Fixes

  • Fixes a bug where the console hogs certain keys (e.g. Enter or the arrow keys) while hidden.

0.3.1

Fixes

  • Fixed the console position changing when the app's window size was changing.

0.3.0

Features

  • Made the console use a window display.
  • Made the console's code more GWT friendly.

0.2.4

Fixes

  • Added refresh() function which should be called when the app's window size is changed. It prevents the console from stretching.

0.2.3

Fixes

  • Fixed console eating touches at the center of the screen.
  • Improved method detection for command completion.

0.2.2

Fixes

  • Disabling the console actually does something now.
  • Increased disposing stability.

0.2.1

Fixes

  • Fixed completer crash when no methods could be found.
  • Allow completer to complete methods from super class (the CommandExecutor base class).

0.2.0

Features

  • Added command completion.

0.1.1

Fixes

  • Fixed issue #8 (needing to double-tap up or down to switch direction in command history).
  • Added ability to cycle through commands (i.e. pressing up at the top of the list will continue from the bottom).

0.1.0 *Initial Release*

Features

  • Scrollable console
  • Command execution
  • Command history (recalling of executed commands)