I developed a little library for debug messages. Why? I hate writing the same code multiple times, so i made this library. Probably there is no need for this but i still release it.
What is Donut?
Donut is a simplified debug message control system for LÖVE
Debug message control system? wth???
You're able to add debug messages like this:
Supported languages
- Lua
- MoonScript
Code: Select all
require("donut")
function love.load()
debug = Donut.init(10, 10)
fps = debug.add("FPS")
random = debug.add("Random")
end
function love.update(dt)
debug.update(fps, love.timer.getFPS())
debug.update(random, math.random(0, 100))
end
function love.keypressed(key, unicode)
if key == "s" then -- show/hide with "s"
debug.toggle()
end
end
function love.draw()
debug.draw()
-- you could also use debug.draw(xoffset, yoffset) to move the message if you're using a cam
end
Code: Select all
require "donut"
love.load = ->
export debug = Donut(10, 10)
export fps = debug\add "FPS"
export random = debug\add "Random"
love.update = (dt) ->
debug\update fps, love.timer.getFPS()
debug\update random, math.random(0, 100)
""
love.keypressed = (key, unicode) ->
debug\toggle if key == "s"
""
love.draw = ->
debug\draw 0, 0
Coming soon...
License
Donut is licensed under the terms of GNU Lesser General Public License v3.
Download
Sourcecode
See Also