Moai SDK
1.5 revision 1 (MoaiEdition)
|
Inherits MOAIGlobalClass< TYPE, SUPER >.
Uses the mask provided to clear the loop flags.
function clearLoopFlags ( [ number mask ] )
mask | ( number ) Optional. Default value is 0xffffffff. |
Alias for MOAIRenderMgr.clearRenderStack (). THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
function clearRenderStack ()
Crashes Moai with a null pointer dereference.
function crash ()
Enters fullscreen mode on the device if possible.
function enterFullscreenMode ()
Exits fullscreen mode on the device if possible.
function exitFullscreenMode ()
Runs the garbage collector repeatedly until no more MOAIObjects can be collected.
function forceGC ()
Converts the number of frames to time passed in seconds.
function framesToTime ( number frames )
frames | ( number ) The number of frames. |
Gets the raw device clock. This is a replacement for Lua's os.time ().
function getDeviceTime ()
Gets the number of frames elapsed since the application was started.
function getElapsedFrames ()
Gets the number of seconds elapsed since the application was started.
function getElapsedTime ()
Generates a histogram of active MOAIObjects and returns it in a table containing object tallies indexed by object class names.
function getHistogram ()
Returns the current loop flags.
function getLoopFlags ()
Gets the total number of objects in memory that inherit MOAILuaObject. Count includes objects that are not bound to the Lua runtime.
function getLuaObjectCount ()
Get the current amount of memory used by MOAI and its subsystems. This will attempt to return reasonable estimates where exact values cannot be obtained. Some fields represent informational fields (i.e. are not double counted in the total, but present to assist debugging) and may be only available on certain platforms (e.g. Windows, etc). These fields begin with a '_' character.
function getMemoryUsage ()
Returns an estimated frames per second based on measurements taken at every render.
function getPerformance ()
Gets the amount of time (in seconds) that it takes for one frame to pass.
function getStep ()
Hides system cursor.
function hideCursor ()
Opens a new window for the application to render on. This must be called before any rendering can be done, and it must only be called once.
function openWindow ( string title, number width, number height )
title | ( string ) The title of the window. |
width | ( number ) The width of the window in pixels. |
height | ( number ) The height of the window in pixels. |
Pauses or unpauses the device timer, preventing any visual updates (rendering) while paused.
function pauseTimer ( boolean pause )
pause | ( boolean ) Whether the device timer should be paused. |
Alias for MOAIRenderMgr.popRenderPass (). THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
function popRenderPass ()
Alias for MOAIRenderMgr.pushRenderPass (). THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
function pushRenderPass ( MOAIRenderable renderable )
renderable | ( MOAIRenderable ) |
Alias for MOAIRenderMgr.removeRenderPass (). THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
function removeRenderPass ( MOAIRenderable renderable )
renderable | ( MOAIRenderable ) |
Generates a histogram of active MOAIObjects.
function reportHistogram ()
Analyze the currently allocated MOAI objects and create a textual report of where they were declared, and what Lua references (if any) can be found. NOTE: This is incredibly slow, so only use to debug leaking memory issues. This will also trigger a full garbage collection before performing the required report. (Equivalent of collectgarbage("collect").)
function reportLeaks ( boolean clearAfter )
clearAfter | ( boolean ) If true, it will reset the allocation tables (without freeing the underlying objects). This allows this method to be called after a known operation and get only those allocations created since the last call to this function. |
Sets the boost threshold, a scalar applied to step. If the gap between simulation time and device time is greater than the step size multiplied by the boost threshold and MOAISim.SIM_LOOP_ALLOW_BOOST is set in the loop flags, then the simulation is updated once with a large, variable step to make up the entire gap.
function setBoostThreshold ( [ number boostThreshold ] )
boostThreshold | ( number ) Optional. Default value is DEFAULT_BOOST_THRESHOLD. |
Sets the amount of time (given in simulation steps) to allow for updating the simulation.
function setCpuBudget ( number budget )
budget | ( number ) Default value is DEFAULT_CPU_BUDGET. |
Enable tracking of every MOAILuaObject so that an object count histogram may be generated.
function setHistogramEnabled ( [ boolean enable ] )
enable | ( boolean ) Optional. Default value is false. |
Enable extra memory book-keeping measures that allow all MOAI objects to be tracked back to their point of allocation (in Lua). Use together with MOAISim.reportLeaks() to determine exactly where your memory usage is being created. NOTE: This is very expensive in terms of both CPU and the extra memory associated with the stack info book-keeping. Use only when tracking down leaks.
function setLeakTrackingEnabled ( [ boolean enable ] )
enable | ( boolean ) Optional. Default value is false. |
Sets the long delay threshold. If the simulation step falls behind the given threshold, the deficit will be dropped: the simulation will neither spin nor boost to catch up.
function setLongDelayThreshold ( [ number longDelayThreshold ] )
longDelayThreshold | ( number ) Optional. Default value is DEFAULT_LONG_DELAY_THRESHOLD. |
Fine tune behavior of the simulation loop. MOAISim.SIM_LOOP_ALLOW_SPIN will allow the simulation step to run multiple times per update to try and catch up with device time, but will abort if processing the simulation exceeds the configured step time. MOAISim.SIM_LOOP_ALLOW_BOOST will permit a *variable* update step if simulation time falls too far behind device time (based on the boost threshold). Be warned: this can wreak havoc with physics and stepwise animation or game AI. Three presets are provided: MOAISim.LOOP_FLAGS_DEFAULT, MOAISim.LOOP_FLAGS_FIXED, and MOAISim.LOOP_FLAGS_MULTISTEP.
function setLoopFlags ( [ number flags ] )
flags | ( number ) Optional. Mask or a combination of MOAISim.SIM_LOOP_FORCE_STEP, MOAISim.SIM_LOOP_ALLOW_BOOST, MOAISim.SIM_LOOP_ALLOW_SPIN, MOAISim.SIM_LOOP_NO_DEFICIT, MOAISim.SIM_LOOP_NO_SURPLUS, MOAISim.SIM_LOOP_RESET_CLOCK. Default value is 0. |
Toggles log messages from Lua allocator.
function setLuaAllocLogEnabled ( [ boolean enable ] )
enable | ( boolean ) Optional. Default value is 'false.' |
Sets the size of each simulation step (in seconds).
function setStep ( number step )
step | ( number ) The step size. Default value is 1 / DEFAULT_STEPS_PER_SECOND. |
Runs the simulation multiple times per step (but with a fixed step size). This is used to speed up the simulation without providing a larger step size (which could destabilize physics simulation).
function setStepMultiplier ( number count )
count | ( number ) Default value is DEFAULT_STEP_MULTIPLIER. |
Sets the tolerance for timer error. This is a multiplier of step. Timer error tolerance is step * timerError.
function setTimerError ( number timerError )
timerError | ( number ) Default value is 0.0. |
Sets the function to call when a traceback occurs in Lua.
function setTraceback ( function callback )
callback | ( function ) Function to execute when the traceback occurs |
Shows system cursor.
function showCursor ()
Converts the number of time passed in seconds to frames.
function timeToFrames ( number time )
time | ( number ) The number of seconds. |