|
|
Function
love.timer.getFPS( )
ret the current frames-per-second. Since it is meant for display-purposes,
the value is only updated each second (this makes the value non-erratic and human-readable
when drawn on screen).
Synopsis
var = love.timer.getFPS( )
Arguments
(None)
Returns
number
The FPS.
Examples
Example 8: FPS and delta-time
function load() local f = love.graphics.newFont(love.default_font, 12) love.graphics.setFont(f) end function draw() -- Draw the current FPS. love.graphics.draw("FPS: " .. love.timer.getFPS(), 50, 50) -- Draw the current delta-time. (The same value -- is passed to update each frame). love.graphics.draw("dt: " .. love.timer.getDelta(), 50, 100) end
Copyright © 2006-2008 LÖVE Development Team.
|