Moai SDK
2.0
|
Additional Inherited Members | |
![]() | |
template<typename TYPE > | |
getListener | |
template<typename TYPE > | |
setListener | |
|
|
Uses the mask provided to clear the loop flags.
function clearLoopFlags ( [ number mask ] )
number | mask 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 ()
|
Converts the number of frames to time passed in seconds.
function framesToTime ( number frames )
number | frames The number of frames. |
|
Get the sim's action tree. This is the 'global' action tree that all newly started actions are automatically added.
function getActionMgr ()
|
Gets the raw device clock. This is a replacement for Lua's os.time ().
function getDeviceTime ()
|
Gets the number of seconds elapsed since the application was started.
function getElapsedTime ()
|
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 lua and texture memory usage measured by MOAI subsystems. This function tries to avoid allocations to minimize skewing the results. Suitable for realtime memory monitoring.
function getMemoryUsagePlain ()
|
Returns an estimated frames per second and other performance counters 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 ()
|
Gets the number of times the sim was stepped since the application was started.
function getStepCount ()
|
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 )
string | title The title of the window. |
number | width The width of the window in pixels. |
number | height The height of the window in pixels. |
|
Pauses or unpauses the device timer, preventing any visual updates (rendering) while paused.
function pauseTimer ( boolean pause )
boolean | pause 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 ( MOAIDrawable renderable )
MOAIDrawable | renderable |
|
Alias for MOAIRenderMgr.removeRenderPass (). THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
function removeRenderPass ( MOAIDrawable renderable )
MOAIDrawable | renderable |
|
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 ] )
number | boostThreshold 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 )
number | budget Default value is DEFAULT_CPU_BUDGET. |
|
Enable incremental garbage collection.
function setGCActive ( boolean active )
boolean | active Default value is false. |
|
Sets a step to use when running the incremental gc each frame.
function setGCStep ( number step )
number | step |
|
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 ] )
number | longDelayThreshold 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 ] )
number | flags 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 ] )
boolean | enable Optional. Default value is 'false.' |
|
Sets the size of each simulation step (in seconds).
function setStep ( number step )
number | step 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 )
number | count Default value is DEFAULT_STEP_MULTIPLIER. |
|
Average delta time over N last frames. This is useful to filter out momentary single-frame spikes. Can make difference even in fixed step setup (helps to avoids double steps).
function setStepSmoothing ( number count )
number | count Number of frames. Default is 0 (no smoothing). |
|
Sets text input rect.
function setTextInputRect ()
|
Sets the tolerance for timer error. This is a multiplier of step. Timer error tolerance is step * timerError.
function setTimerError ( number timerError )
number | timerError Default value is 0.0. |
|
Sets the function to call when a traceback occurs in Lua.
function setTraceback ( function callback )
function | callback 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 )
number | time The number of seconds. |