Difference between revisions of "Monocle"

(Created page with "{{#set:Name=Monocle}} {{#set:LOVE Version=0.9.0}} {{#set:Description= Debugging & Expression watching for Love2D}} '''Monocle'''is a simple, but very helpful debugging library f...")
Line 1: Line 1:
{{#set:LOVE Version=0.9.0}}
{{#set:LOVE Version=0.9.1}}
{{#set:Description= Debugging & Expression watching for Love2D}}
{{#set:Description= Debugging & Expression watching for Love2D}}

Latest revision as of 05:48, 25 June 2014

Monocleis a simple, but very helpful debugging library for Love2D.
Monocle can watch variables and expressions and keep them pinned to the top left of the screen.</br> If a problem occurs, the game will issue an error, but the watched expressions stay on the screen.</br> Best of all, the game will watch files and automatically reload the game when those files have been changed.

Basic implementation:

require 'monocle/monocle'
-- The most basic way to watch any expression or variable:
Monocle.watch("FPS", function() return math.floor(1/love.timer.getDelta()) end)
function love.update(dt)
function love.draw()
function love.textinput(t)
function love.keypressed(text)

Monocle can also be started with options in mind that are tailored to your needs!

Monocle.new({       -- ALL of these parameters are optional!
   isActive=true,          -- Whether the debugger is initially active
   customPrinter=false,    -- Whether Monocle prints status messages to the output
   printColor = {51,51,51},-- Color to print with
   debugToggle='`',        -- The keyboard button for toggling Monocle
   filesToWatch=           -- Files that, when edited, cause the game to reload automatically

You can find it at [1].