Originally Posted by zireko
I simply want to ask how I would get the frame rate to display in a small window? I currently have this small lua and I'm just trying to call a function. This is my first thing and I'm trying to play around with a very very simple addon. My lua code is listed below.
Lua Code:
function GetFramerate(number) end
This is the only line of code I currently have and I'm not getting any lua error or anything. But it is not displaying anywhere. Do I need to make a frame for it to display in? If so how would I do that easy methods only please.
|
The code above wont do anything because all you are doing is defining a new function called GetFramerate(paramter = number)
What you want to do is "CALL" the function GetFramerate, not re-define it.
e.g.
fps = GetFramerate()
d(fps)
will display the framerate in the console.
For "constant" updating you would need to hook a callback, so, periodically it would call whatever function you want to perform some action, like, getting the framerate every 100 milliseconds, etc...
If you want to display it on more than the console output, yes, you would need to make a "frame" for it.