Application

public class
loom.Application

Description

The global static class that drives execution of our game.

Corresponds to lmApplication.cpp; makes most basic stuff in Loom happen!

API overview

Constructor

Application ()

Attributes

Public attributes

applicationActivated: NativeDelegate static native

Called when the application comes into the foreground

applicationDeactivated: NativeDelegate static native

Called when the application goes into the background

assetCommandDelegate: NativeDelegate static native

Fired by the asset protocol when debug console commands come in

event: NativeDelegate static native

Fired when generic system events come in

group: LoomGroup

Root LoomGroup; add all your LoomObjects here

loomConfigJSON: String static native

Access to the copy of loom.config embedded in the application

onStart: OnStart static

Delegate called at start of the first rendered frame

ticks: NativeDelegate static native

Delegate for frames; add your callbacks to this to get called at the start of every frame!

No parameters

version: String static native

The version of Loom we're running against

Protected attributes

Functions

Public functions

compilerEnabled (): Boolean static native

True if the LoomScript compiler is included in this build

fireGenericEvent ( type: String , payload: String = ): Void static native

Call to fire a generic system event; events may be received by script or by native code

getBootAssembly (): String static native

The path to the assembly we'll load; by default "Main.loom"

onFrame (): Void

Called every frame by the TimeManager

onTick (): Void

Called every tick (ie, 60Hz) by the TimeManager

reloadMainAssembly (): Void static native

Call to trigger a restart of the VM and reload of the main assembly at the next convenient point

Protected functions

Constructor

Application ()

Attributes

applicationActivated: NativeDelegate

static native

Called when the application comes into the foreground.

No parameters.

applicationDeactivated: NativeDelegate

static native

Called when the application goes into the background.

No parameters.

assetCommandDelegate: NativeDelegate

static native

Fired by the asset protocol when debug console commands come in.

One parameter, the entire command passed in as a String.

event: NativeDelegate

static native

Fired when generic system events come in. First parameter is string containing type, second is string containing payload if any. Events be fired from either native or script code; this is a shared event bus.

group: LoomGroup

Root LoomGroup; add all your LoomObjects here.

loomConfigJSON: String

static native

Access to the copy of loom.config embedded in the application.

onStart: OnStart

static

Delegate called at start of the first rendered frame.

ticks: NativeDelegate

static native

Delegate for frames; add your callbacks to this to get called at the start of every frame!

No parameters.

version: String

static native

The version of Loom we're running against.

Protected attributes

Functions

compilerEnabled (): Boolean

static native

True if the LoomScript compiler is included in this build.



fireGenericEvent ( type: String , payload: String = ): Void

static native

Call to fire a generic system event; events may be received by script or by native code. See ApplicationEventType and Application.event for further information.

Parameters

type: String
payload: String =


getBootAssembly (): String

static native

The path to the assembly we'll load; by default "Main.loom".



getFullTypeName (): String
Inherited from Object

native

Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.


Returns

String fully qualified type name of the Object.

getType (): Type
Inherited from Object

native

Gets the Type that describes the Object.


Returns

Type The Type that describes the object.

getTypeName (): String
Inherited from Object

native

Gets the type name of the Object.


Returns

String type name of the Object.

onFrame (): Void

Called every frame by the TimeManager.



onTick (): Void

Called every tick (ie, 60Hz) by the TimeManager.



reloadMainAssembly (): Void

static native

Call to trigger a restart of the VM and reload of the main assembly at the next convenient point.



setMemoryWarningLevel ( megabytes: Number ): Void
Inherited from BaseApplication

Sets a warning level in megabytes for the Application's VM If the Application VM exceeds this level a warning will be displayed in the console. Please note that this warning level is purely for the scripting VM and not other assets that may be loaded

Parameters

megabytes: Number The amount of ram in megabytes that causes a warning when exceeded


toString (): String
Inherited from Object

native

Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().


Returns

String String that described the Object.

Protected functions

: