enterFrame

Type Event
Dispatch chain Runtime
Revision 2017.3060
Keywords enterFrame, runtime
See also Basic Interactivity and Event Detection (guide)

Overview

"enterFrame" events occur at the frames-per-second interval of the application, either 30 or 60 as specified in config.lua. They are only dispatched to the global Runtime object.

Properties

Examples

Event Name
local myListener = function( event )
    print( "Listener called with event of type " .. event.name )
end
Runtime:addEventListener( "enterFrame", myListener )
Event Time
local function printTimeSinceStart( event )
    print ( tostring(event.time/1000) .. " seconds since app started." )
end 
Runtime:addEventListener( "enterFrame", printTimeSinceStart )