Skip to content
On this page

@thejsngin/jsngin / Exports

@thejsngin/jsngin

Table of contents

Interfaces

Type Aliases

Variables

Functions

Events

Type Aliases

BaseEnv

Ƭ BaseEnv: Object

Type declaration

NameType
domElement?HTMLElement
gameObjectUserData?any
loadGameObjectUserData?any

Defined in

src/game/interface.ts:25


Callback

Ƭ Callback<eventType>: (gameInstance: any, gameObjectInstance: any, componentHelpers: any, ...data: eventType["data"]) => eventType["returnVal"]

Type parameters

NameType
eventTypeextends CustomEvent

Type declaration

▸ (gameInstance, gameObjectInstance, componentHelpers, ...data): eventType["returnVal"]

Parameters
NameType
gameInstanceany
gameObjectInstanceany
componentHelpersany
...dataeventType["data"]
Returns

eventType["returnVal"]

Defined in

src/interface.ts:11


CustomEvent

Ƭ CustomEvent: Object

Type declaration

NameType
dataany[]
eventLevelEventLevel
namestring
returnValany
waitForCompletionboolean

Defined in

src/interface.ts:3


DisposeEventParameters

Ƭ DisposeEventParameters: []

Defined in

src/interface.ts:135


DisposeEventReturnValue

Ƭ DisposeEventReturnValue: Promise<void>

Defined in

src/interface.ts:136


EventLevel

Ƭ EventLevel: ("game" | "gameObject" | "anonymous")[]

Defined in

src/interface.ts:1


InitEventParameters

Ƭ InitEventParameters: []

Defined in

src/interface.ts:118


InitEventReturnValue

Ƭ InitEventReturnValue: any

Defined in

src/interface.ts:119


LoadCompleteEventParameters

Ƭ LoadCompleteEventParameters: []

Defined in

src/interface.ts:101


LoadCompleteEventReturnValue

Ƭ LoadCompleteEventReturnValue: any

Defined in

src/interface.ts:102


LoadErrorEventParameters

Ƭ LoadErrorEventParameters: Object

Type declaration

NameType
exceptionError
failLoad() => void
failednumber
settlednumber
totalnumber

Defined in

src/interface.ts:66


LoadErrorEventReturnValue

Ƭ LoadErrorEventReturnValue: any

Defined in

src/interface.ts:67


LoadEventParameters

Ƭ LoadEventParameters: Object

Type declaration

NameType
addToLoadTracking(promise: Promise<any>, weight?: number) => void

Defined in

src/interface.ts:32


LoadEventReturnValue

Ƭ LoadEventReturnValue: any

Defined in

src/interface.ts:33


LoadFailedEventParameters

Ƭ LoadFailedEventParameters: []

Defined in

src/interface.ts:83


LoadFailedEventReturnValue

Ƭ LoadFailedEventReturnValue: any

Defined in

src/interface.ts:84


LoadProgressEventParameters

Ƭ LoadProgressEventParameters: Object

Type declaration

NameType
failLoad() => void
failednumber
settlednumber
totalnumber

Defined in

src/interface.ts:49


LoadProgressEventReturnValue

Ƭ LoadProgressEventReturnValue: any

Defined in

src/interface.ts:50


ResourceEventParameters

Ƭ ResourceEventParameters: []

Defined in

src/interface.ts:15


ResourceEventReturnValue

Ƭ ResourceEventReturnValue: Promise<any & { resourceName: string }> | any & { resourceName: string }

Defined in

src/interface.ts:16

Variables

disposeEvent

Const disposeEvent: "dispose"

Defined in

src/interface.ts:134


initEvent

Const initEvent: "init"

Defined in

src/interface.ts:117


loadCompleteEvent

Const loadCompleteEvent: "loadComplete"

Defined in

src/interface.ts:100


loadErrorEvent

Const loadErrorEvent: "loadError"

Defined in

src/interface.ts:65


loadEvent

Const loadEvent: "load"

Defined in

src/interface.ts:31


loadFailedEvent

Const loadFailedEvent: "loadFailed"

Defined in

src/interface.ts:82


loadProgressEvent

Const loadProgressEvent: "loadProgress"

Defined in

src/interface.ts:48


resourceEvent

Const resourceEvent: "resource"

Defined in

src/interface.ts:14

Functions

game

game(gameObject, env, loadGameObject?): Promise<GameInstance>

Creates a gameInstance and then returns it.

Parameters

NameType
gameObjectGameObject
env{ [key: string]: any; } & BaseEnv
loadGameObject?GameObject

Returns

Promise<GameInstance>

Defined in

src/game/interface.ts:35

Events

DisposeEvent

Ƭ DisposeEvent: Object

Fired when the gameObject/Component is deleted.

Type declaration

NameType
dataDisposeEventParameters
eventLevel["gameObject", "anonymous"]
name"dispose"
returnValDisposeEventReturnValue
waitForCompletiontrue

Defined in

src/interface.ts:142


InitEvent

Ƭ InitEvent: Object

AutoFired after LoadCompleteEvent. The order of this event for the gameObject tree is post order.

Type declaration

NameType
dataInitEventParameters
eventLevel["game", "gameObject"]
name"init"
returnValInitEventReturnValue
waitForCompletiontrue

Defined in

src/interface.ts:125


LoadCompleteEvent

Ƭ LoadCompleteEvent: Object

AutoFired when all the tracked promises are setteled.

Type declaration

NameType
dataLoadCompleteEventParameters
eventLevel["game"]
name"loadComplete"
returnValLoadCompleteEventReturnValue
waitForCompletiontrue

Defined in

src/interface.ts:108


LoadErrorEvent

Ƭ LoadErrorEvent: Object

Fired during load, everytime a tracked promise is rejected.

Type declaration

NameType
dataLoadErrorEventParameters
eventLevel["game"]
name"loadError"
returnValLoadErrorEventReturnValue
waitForCompletionfalse

Defined in

src/interface.ts:73


LoadEvent

Ƭ LoadEvent: Object

Autofired before initializing the world and after the resource event.

Type declaration

NameType
dataLoadEventParameters
eventLevel["game" | "gameObject"]
name"load"
returnValLoadEventReturnValue
waitForCompletiontrue

Defined in

src/interface.ts:39


LoadFailedEvent

Ƭ LoadFailedEvent: Object

AutoFired when the failLoad function is called in either loadErrorEvent or LoadProgressEvent. Loading process is halted and the gameObjectInstance being created is disposed inidiately after this.

Type declaration

NameType
dataLoadFailedEventParameters
eventLevel["game"]
name"loadFailed"
returnValLoadFailedEventReturnValue
waitForCompletionfalse

Defined in

src/interface.ts:90


LoadProgressEvent

Ƭ LoadProgressEvent: Object

Fired during load, everytime a tracked promise is resolved. This Event can be used to track load progress.

Type declaration

NameType
dataLoadProgressEventParameters
eventLevel["game"]
name"loadProgress"
returnValLoadProgressEventReturnValue
waitForCompletionfalse

Defined in

src/interface.ts:56


ResourceEvent

Ƭ ResourceEvent: Object

First event to be fired. The returned value or resolved value of the returned promise will be used as the the resource for this component. This can later be accessed at gameObjecInstance.components[componentName].

Type declaration

NameType
data[]
eventLevel["anonymous"]
name"resource"
returnValResourceEventReturnValue
waitForCompletionfalse

Defined in

src/interface.ts:22