Originaly created and writen by kalle2990
Tired of having to restart your whole game when an error occurs or attaching a console, which you have to switch to, just to see your debug printings? Tired of adding extra variable in text to your graphical experience, taking space and looks misplaced? Tired of not having the possibility to execute scripts in-game without attaching a GUI or even writing one yourself? Now all of this is unnecessary!
By pessing CTRL/Shift + F8 you'll have access to these key features in an on-screen console:
- Code Hotswapping, press F5 while you are at the console to reload your code or simply set _DebugSettings.LiveAuto to true to automaticly reload your code when it's changed, controle the files that should be monitored by editing _DebugSettings.LiveFile
- Pess CTRL/Shift + F8 to Show/Hide the console.
- Type _DebugSettings.Settings() to see a list of available variables that you can change.
- HUD feed of everything that is going on under the under the hood of you application in real time.
- Use the arrow keys while you are coding in the console to browse a list of possible autocompletions and press tab to autocomplete the word.
- Use Shift+Arrow keys to browse input histoy.
- Copy and Past by pressing Ctrl+V/C
Github's repo of LoveDebug.
I'll update this post with the new versions that you guys might post.
- Put 'lovedebug.lua' wherever you want. (Ex: root of the working directory)
- Add require('lovedebug') to the beginning of you code in main.lua Ex:
Code: Select all
require("lovedebug") function love.load() end
- Lunch your game and press Ctrl/Shit + F8
- And there you have it, your own onscreen interactive console.
- For more help just run _DebugSettings.Settings()
Latest Unofficial Version 1.4.4 by beuz
Latest Official Version 1.1.5 (might not work):
Complete list of features:
- A scrollable list of the output.
- Some errors are reedirected to the console instead of crashing löve.
- Only prints the same error once, useful for errors in love.update, can be toggled.
- Semi-transparent console overlay, the console's color can be changed in _DebugSettings.OverlayColor
- CTRL/Shift + F8 toggle of the console
- Text input for executing lua snippets right in your console
- Graphic feedback telling about unseen lines ("..." on the bottom right)
- Variable proposal and autocomplition (select a proposal by using the arrow keys and press tab to autocomplete).
- Fast jumping to the bottom of the console by pressing lCtrl+Middle mouse button or by providing a code to the console.
- Use the home and the end keys to jump to the end or to beginning of the line.
- Browse code history by using the arrow keys while pressing the Shift key.
- LiveCoding, you can reload your code by pressing F5 while at the console or by setting _DebugSettings.LiveAuto to true and you can reload more than one file, see _DebugSettings.Settings().
- Type 'clear' and press enter to clear the console.
- Type Ctrl+C/V to copy or to past text into the console input.
- HUD with the latest prints and errors that your application emitted.
- Add your own
Version 1.4.4 (Not Official) by beuz
- Fixed commented lines.
- Fixed some incompatibilities with LÖVE 0.10.0's love.run, the background color will not reset to black now and this should probably fix loads of other unknown bugs.
- Updated to LÖVE 0.10.0.
- Fixed a bug where the overlay console wouldn't show up correcly when using stencils.
- Added prints and news feed on top of your screen. This way you won't miss any error that might show up.
- Added two new settings, HaltExecution and AutoScroll.
- HaltExecution: setting to control if execution of the love program is halted while console is open
- AutoScroll: setting to control if the console auto scrolls once output fills the console.
- Fixed a bug where the console was not appearing.
- Getting ready for android.
- You can now use tables in _DebugSettings.LiveFile to reload multiple files.
- Errors from reloaded files are now printed with an "[ERROR]" prefix. (forgot to write this on github)
- Fixed a bug where keys weren't being detected when Ctrl or Shift keys were being pressed.
- By setting _DebugSettings.LiveAuto to true the code will automaticly reload itself when it's modified.
- You can now Copy and Past by pressing Ctrl+C/V
- Converted to LÖVE 0.9.0
- To jump to the bottom of the console you now have to press lCtrl+middle mouse buttons instead of just the middle mouse button.
- You can now do code hotswapping by accessing the console and by pressing the F5 button.
- Added two new variables to _DebugSettings, 'LiveFile' and 'LiveReset', see _DebugSettings.Settings() for more information.
- Some more cleaning up of the code.
- Fixes auto-complete options not being reset in certain conditions.
- Adds a command history, navigatable with up and down arrow keys. This conflicts with selection of auto-complete options, but you can force history navigation by using shift+up and shift+down.
- Reworks error-checking in entered commands. A nice benefit is that the [string "possibly a long command"]:1: part no longer shows up, which just duplicated something that was printed right before.
- Improves _Debug.findLocation (including: no more loadstring, no __index side-effects, finding object:methods).
- Improves _Debug.updateProposals (only valid identifiers are proposed, keywords are proposed if there is no preceding . or :).
- Adds support for the home and end keys.
- Cleans up some dead code.
- Now only allows you to enter characters in ASCII, because the rest of the library handles non-ASCII unicode very poorly.
- Auto-complete now works when inserting text in the middle instead of only at the end.
- Up and down change which auto-complete option you're going to select.
- Much better drawn auto-complete options.
- Suppresses auto-complete when in the middle of an identifier.
- Brings back keyRepeat, in a way that doesn't interfere with the game.
- Fixes printing multiple things in 3 ways (see if you can find them all!).
- Syntax errors in commands now get a sensible error message.
- Tab completion now only done when the overlay is visible.
- Removes a useless loop in _Debug.findLocation.
- Uses multiple argument form of love.keyboard.isDown in _Debug.handleKey.
- Removes keyRepeat, because that shit's evil.
- Fixes "double click" bug.
- Fixes indentation.
- We now have repetitive keyboard behavior, AWESOME
- Added a new functionality that jumps you to the last output in the conole when you provide a command
- Fixed a font related bug
- Added a new functionality that enables you to jump right to the bottom of the console by pressing the middle mouse button.
- Fixed some bugs
- Added a new functionality that autocompletes the variable to the current proposal by pressing tab
- Converted to LÖVE 0.8.0
- Added a new functionality that enables you to change the 'f8' key to what you want by changing the _lovedebugpresskey='the key you want'
- Added Shift + F8 console opening, the old one still remains (Thank you miko)
- Everything except for settings (which has its own global table) is now put into the local table _Debug (Thank you tentus)
- Fixed the console to be hidden at the start
- Added _OverlayColor to global settings (see _Settings() for a list of settings) Changed location as of 1.1.5 to _DebugSettings.Settings()
- Initial version