FPSGraph. A simple lightweight graphing utility

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

FPSGraph. A simple lightweight graphing utility

Post by substitute541 »

Made out of my free time while taking a break from bigger projects.

A simple library that graphs both FPS and Memory any set of values you want to graph, including FPS and Memory. You can also have multiple graphs (used ordinary Lua tables instead of objects to make the lib smaller.)

Github repo
Last edited by substitute541 on Thu Apr 03, 2014 1:45 am, edited 1 time in total.
Currently designing themes for WordPress.

Sometimes lurks around the forum.
WetDesertRock
Citizen
Posts: 67
Joined: Fri Mar 07, 2014 8:16 pm

Re: FPSGraph. A simple FPS and Memory graphing utility

Post by WetDesertRock »

I like it, just added it to my project.

Couple of thoughts:
1) I sense some copy and paste, in your example you have dt in the draw method. It doesn't seem to need to be there.
2) Something happened in my code, and messed up the line width of your graph. Realized you never had a love.graphics.setLineWidth(1) there. Perhaps something like that? I'm also new to love, so not sure if there is a convention I'm missing.
3) I'd enjoy hooking other things (game specific) to the graph. Perhaps an example of how to do this? Wasn't aware I could till I read the source more in depth.
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: FPSGraph. A simple FPS and Memory graphing utility

Post by substitute541 »

WetDesertRock wrote:I like it, just added it to my project.

Couple of thoughts:
1) I sense some copy and paste, in your example you have dt in the draw method. It doesn't seem to need to be there.
2) Something happened in my code, and messed up the line width of your graph. Realized you never had a love.graphics.setLineWidth(1) there. Perhaps something like that? I'm also new to love, so not sure if there is a convention I'm missing.
3) I'd enjoy hooking other things (game specific) to the graph. Perhaps an example of how to do this? Wasn't aware I could till I read the source more in depth.
1) Haha, didn't actually notice that :P
2) Yeah, mostly so you can change the change the color and line style by putting the setColor and setLineWidth methods before you draw your graph.
3) You can do that b making a custom update function that takes in your graph, dt, and any other optional arguments, then passing the values and labels of your graphs to the fpsGraph.updateGraph function. Something like:

Code: Select all

function updateGraphRandomly(graph, dt, arg)
	local val = love.math.random()*arg

	fpsGraph.updateGraph(graph, val, "Random: " .. math.floor(val*10)/10, dt)
end
Anyways, I'm gonna add more comments to the source code so others can understand it better.
Currently designing themes for WordPress.

Sometimes lurks around the forum.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests