Difference between revisions of "Donut"
(Created page with "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: [[File:donutdebugscreen.pn...") |
|||
(7 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | {{#set:Keyword=Debug}} | ||
Donut is a simplified debug message control system for LÖVE. | Donut is a simplified debug message control system for LÖVE. | ||
Line 6: | Line 7: | ||
[[File:donutdebugscreen.png|Donut library screenshot]] | [[File:donutdebugscreen.png|Donut library screenshot]] | ||
− | == Usage == | + | == Supprted languages == |
+ | * Lua | ||
+ | * Moonscript | ||
+ | |||
+ | == Usage (Lua) == | ||
<source lang="lua"> | <source lang="lua"> | ||
− | require("donut | + | require("donut") |
function love.load() | function love.load() | ||
Line 29: | Line 34: | ||
function love.draw() | function love.draw() | ||
debug.draw() | debug.draw() | ||
+ | -- you could also use debug.draw(xoffset, yoffset) to move the message if you're using a cam | ||
end | end | ||
+ | </source> | ||
+ | |||
+ | == Usage (MoonScript) == | ||
+ | <source lang="lua"> | ||
+ | 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 | ||
</source> | </source> | ||
Line 35: | Line 63: | ||
coming soon... | coming soon... | ||
+ | |||
+ | == License == | ||
+ | |||
+ | Donut is licensed under the terms of [http://www.gnu.org/copyleft/lgpl.html GNU Lesser General Public License v3]. | ||
== Download == | == Download == | ||
* [https://github.com/Kasoki/Donut/zipball/master Download from my master-branch] | * [https://github.com/Kasoki/Donut/zipball/master Download from my master-branch] | ||
+ | * [https://github.com/Kasoki/Donut/zipball/v0.1.4 Download v0.1.4] | ||
+ | * [https://github.com/Kasoki/Donut/zipball/v0.1.3 Download v0.1.3] | ||
+ | * [https://github.com/Kasoki/Donut/zipball/v0.1.2 Download v0.1.2] | ||
* [https://github.com/Kasoki/Donut/zipball/v0.1.1 Download v0.1.1] | * [https://github.com/Kasoki/Donut/zipball/v0.1.1 Download v0.1.1] | ||
* [https://github.com/Kasoki/Donut/zipball/v0.1 Download v0.1] | * [https://github.com/Kasoki/Donut/zipball/v0.1 Download v0.1] | ||
Line 46: | Line 81: | ||
* [http://github.com/Kasoki/Donut Donut on Github] | * [http://github.com/Kasoki/Donut Donut on Github] | ||
− | {{#set:LOVE Version= | + | == See Also == |
+ | |||
+ | * [https://love2d.org/forums/viewtopic.php?f=5&t=8103 Donut post in LÖVE forum] | ||
+ | |||
+ | {{#set:LOVE Version=Any}} | ||
{{#set:Description=Simplified debug message control system}} | {{#set:Description=Simplified debug message control system}} | ||
[[Category:Libraries]] | [[Category:Libraries]] |
Latest revision as of 15:35, 22 December 2016
Donut is a simplified debug message control system for LÖVE.
Contents
Debug message control system? wth???
You're able to add debug messages like this:
Supprted languages
- Lua
- Moonscript
Usage (Lua)
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
Usage (MoonScript)
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
Documentation
coming soon...
License
Donut is licensed under the terms of GNU Lesser General Public License v3.
Download
- Download from my master-branch
- Download v0.1.4
- Download v0.1.3
- Download v0.1.2
- Download v0.1.1
- Download v0.1