Click or drag to resize
CoronaRuntime Class

Runtime used to run a Corona project and manage its lifetime via its suspend, resume, and terminate methods and events.

You would not normally create a CoronaRuntime instance yourself. Instead, you would use a Corona runtime object provided by a "CoronaLabs.Corona.WinRT.Phone.CoronaPanel" Xaml control.

Inheritance Hierarchy
SystemObject
  CoronaLabs.Corona.WinRTCoronaRuntime

Namespace: CoronaLabs.Corona.WinRT
Assembly: CoronaLabs (in CoronaLabs.dll) Version: 255.255.255.255
Syntax
public sealed class CoronaRuntime : __ICoronaRuntimePublicNonVirtuals, 
	__ICoronaRuntimeProtectedNonVirtuals

The CoronaRuntime type exposes the following members.

Constructors
  NameDescription
Public methodCoronaRuntime
Creates a new Corona runtime with the given interop settings.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodResume

Resumes the runtime, if currently suspended.

This will raise an "applicationResume" system event in Lua.

Public methodRun

Starts executing the "resource.car" or "main.lua" file found under the default resource directory specified by the DefaultResourceDirectoryPath property.

If the runtime is currently executing a Corona project, then it will be terminated before running a new one.

Public methodRun(String)

Starts the Corona runtime by executing the given *.lua or *.car file.

If the runtime is currently executing a Corona project, then it will be terminated before running a new one.

Public methodRunInDirectory

Starts the Corona runtime by using the given path as the resource directory and executing the "resource.car" or "main.lua" file found it it.

If the runtime is currently executing a Corona project, then it will be terminated before running a new one.

Public methodRunUsing

Starts the Corona runtime using the given launch settings.

If the runtime is currently executing a Corona project, then it will be terminated before running a new one.

Public methodSuspend

Suspends/pauses the runtime, if currently running.

This will raise an "applicationSuspend" system event in Lua.

Public methodTerminate

Exits and destroys the runtime, if not done already.

This will raise an "applicationExit" system event in Lua.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyState
Indicates if the Corona runtime is currently running, suspended, terminated, etc.
Top
Events
  NameDescription
Public eventLoaded

Raised after loading the "config.lua" file and just but before executing the "main.lua" file.

This is the application's opportunity to register custom APIs into Lua.

Public eventResumed
Raised when the Corona runtime has been resumed after a suspend.
Public eventStarted
Raised just after the "main.lua" file has been executed by the Corona runtime.
Public eventSuspended

Raised when the Corona runtime has been suspended which pauses all rendering, audio, timers and other Corona related operations.

This is typically raised when the end-user navigates to another app or when the power button has been pressed.

Public eventTerminating

Raised just before the Corona runtime environment is about to be terminated.

This typically happens when the end-user backs out of the app, the Corona XAML control has been unloaded from the page, or when the runtime's Terminate() method has been called.

Top
See Also