Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Mechazawa/Love-Debug-Graph
An fps/memory/misc graph utillity for Löve2D
https://github.com/Mechazawa/Love-Debug-Graph
debugger love2d lua
Last synced: 3 days ago
JSON representation
An fps/memory/misc graph utillity for Löve2D
- Host: GitHub
- URL: https://github.com/Mechazawa/Love-Debug-Graph
- Owner: Mechazawa
- License: unlicense
- Created: 2015-12-26T13:09:52.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-17T14:27:58.000Z (about 7 years ago)
- Last Synced: 2024-10-29T20:17:23.975Z (6 days ago)
- Topics: debugger, love2d, lua
- Language: Lua
- Homepage:
- Size: 4.88 KB
- Stars: 34
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-love2d - debugGraph - Small OO FPS graphing utillity based on FPSGraph. (Development)
README
Löve Debug Graph
------------------A Löve2D graph tool for drawing FPS, memory or custom graphs.
![](http://i.imgur.com/YiliXZQ.png)
## Usage
```lua
debugGraph = require 'debugGraph'-- https://love2d.org/wiki/General_math
-- Returns 'n' rounded to the nearest 'deci'th (defaulting whole numbers).
function math.round(n, deci)
deci = 10^(deci or 0)
return math.floor(n*deci+.5)/deci
endfunction love.load()
fpsGraph = debugGraph:new('fps', 0, 0)
memGraph = debugGraph:new('mem', 0, 30)
dtGraph = debugGraph:new('custom', 0, 60)
endfunction love.update(dt)
-- Update the graphs
fpsGraph:update(dt)
memGraph:update(dt)-- Update our custom graph
dtGraph:update(dt, math.floor(dt * 1000))
dtGraph.label = 'DT: ' .. math.round(dt, 4)
endfunction love.draw()
-- Draw graphs
fpsGraph:draw()
memGraph:draw()
dtGraph:draw()
endfunction love.keypressed(key)
if key == 'escape' then
love.event.quit()
end
end
```## Configuration
Key | Default | Description
---------|---------------|----------------------------
x | 0 | The X position of the graph
y | 0 | The Y position of the graph
width | 50 | The graph width
height | 30 | The graph height
delay | 0.5 | The update delay in seconds
label | #graph type# | The graph label
font | Vera Sans 8px | The label font