returns for events + good instance creation

master
Theunis J. Botha 2021-09-19 21:38:53 +02:00
parent 3cea5e05b2
commit 85f5a8bb2f
15 changed files with 260 additions and 240 deletions

243
dist/r3.js vendored
View File

@ -1,6 +1,6 @@
class R3 {
static version = '2.0.784';
static compileDate = '2021 Sep 19 - 21:28:13 pm';
static version = '2.0.788';
static compileDate = '2021 Sep 19 - 21:34:33 pm';
}
class Runtime {
@ -955,9 +955,9 @@ class SystemDOM extends System {
/**
* OnDomComponentInitialized()
* - Listens to events of type Event.DOM_COMPONENT_INITIALIZED and executes this function.
* - Listens to events of type Event.DOM_COMPONENT_INITIALIZED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnDomComponentInitialized(object) {
@ -1139,9 +1139,9 @@ class SystemInput extends System {
/**
* OnTouchStart()
* - Listens to events of type Event.TOUCH_START and executes this function.
* - Listens to events of type Event.TOUCH_START and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnTouchStart(object) {
@ -1149,9 +1149,9 @@ class SystemInput extends System {
/**
* OnTouchEnd()
* - Listens to events of type Event.TOUCH_END and executes this function.
* - Listens to events of type Event.TOUCH_END and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnTouchEnd(object) {
@ -1159,9 +1159,9 @@ class SystemInput extends System {
/**
* OnTouchMove()
* - Listens to events of type Event.TOUCH_MOVE and executes this function.
* - Listens to events of type Event.TOUCH_MOVE and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnTouchMove(object) {
@ -1169,9 +1169,9 @@ class SystemInput extends System {
/**
* OnTouchCancel()
* - Listens to events of type Event.TOUCH_CANCEL and executes this function.
* - Listens to events of type Event.TOUCH_CANCEL and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnTouchCancel(object) {
@ -1179,9 +1179,9 @@ class SystemInput extends System {
/**
* OnKeyboardDown()
* - Listens to events of type Event.KEYBOARD_DOWN and executes this function.
* - Listens to events of type Event.KEYBOARD_DOWN and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnKeyboardDown(object) {
@ -1189,9 +1189,9 @@ class SystemInput extends System {
/**
* OnKeyboardUp()
* - Listens to events of type Event.KEYBOARD_UP and executes this function.
* - Listens to events of type Event.KEYBOARD_UP and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnKeyboardUp(object) {
@ -1199,9 +1199,9 @@ class SystemInput extends System {
/**
* OnMouseDown()
* - Listens to events of type Event.MOUSE_DOWN and executes this function.
* - Listens to events of type Event.MOUSE_DOWN and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnMouseDown(object) {
@ -1209,9 +1209,9 @@ class SystemInput extends System {
/**
* OnMouseUp()
* - Listens to events of type Event.MOUSE_UP and executes this function.
* - Listens to events of type Event.MOUSE_UP and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnMouseUp(object) {
@ -1219,9 +1219,9 @@ class SystemInput extends System {
/**
* OnMouseMove()
* - Listens to events of type Event.MOUSE_MOVE and executes this function.
* - Listens to events of type Event.MOUSE_MOVE and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnMouseMove(object) {
@ -1229,9 +1229,9 @@ class SystemInput extends System {
/**
* OnMouseWheel()
* - Listens to events of type Event.MOUSE_WHEEL and executes this function.
* - Listens to events of type Event.MOUSE_WHEEL and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnMouseWheel(object) {
@ -1366,7 +1366,7 @@ class SystemLinking extends System {
/**
* OnObjectCreated()
* - Listens to events of type OBJECT_CREATED and executes this function.
* - Listens to events of type Event.OBJECT_CREATED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return
*/
@ -1378,7 +1378,7 @@ class SystemLinking extends System {
/**
* OnObjectInitialized()
* - Listens to events of type OBJECT_INITIALIZED and executes this function.
* - Listens to events of type Event.OBJECT_INITIALIZED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return
*/
@ -1390,7 +1390,7 @@ class SystemLinking extends System {
/**
* OnInstanceCreated()
* - Listens to events of type INSTANCE_CREATED and executes this function.
* - Listens to events of type Event.INSTANCE_CREATED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return
*/
@ -1402,7 +1402,7 @@ class SystemLinking extends System {
/**
* OnCreateInstanceBefore()
* - Listens to events of type CREATE_INSTANCE_BEFORE and executes this function.
* - Listens to events of type Event.CREATE_INSTANCE_BEFORE and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return boolean delayInstance which indicates whether or not instance creation is delayed (handled) by
* another system. (i.e. where instance creation order is of importance)
@ -1528,9 +1528,9 @@ class SystemRender extends System {
/**
* OnInstanceCreated()
* - Listens to events of type Event.INSTANCE_CREATED and executes this function.
* - Listens to events of type Event.INSTANCE_CREATED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnInstanceCreated(object) {
@ -1668,9 +1668,9 @@ class SystemRuntime extends System {
/**
* OnGetRuntime()
* - Listens to events of type Event.GET_RUNTIME and executes this function.
* - Listens to events of type Event.GET_RUNTIME and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnGetRuntime(object) {
@ -1696,9 +1696,9 @@ class SystemRuntime extends System {
/**
* OnProjectInitialized()
* - Listens to events of type Event.PROJECT_INITIALIZED and executes this function.
* - Listens to events of type Event.PROJECT_INITIALIZED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnProjectInitialized(object) {
@ -1945,9 +1945,9 @@ class SystemStorage extends System {
/**
* OnImageComponentInitialized()
* - Listens to events of type Event.IMAGE_COMPONENT_INITIALIZED and executes this function.
* - Listens to events of type Event.IMAGE_COMPONENT_INITIALIZED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnImageComponentInitialized(object) {
@ -2190,89 +2190,87 @@ class Event {
}
Event.BEFORE_RENDER = 0x1;
Event.COMPONENT_CREATED = 0x2;
Event.COMPONENT_INITIALIZED = 0x3;
Event.CREATE_INSTANCE_BEFORE = 0x4;
Event.DISPOSE_INSTANCE = 0x5;
Event.DISPOSE_OBJECT = 0x6;
Event.DOM_COMPONENT_INITIALIZED = 0x7;
Event.ENTITY_CREATED = 0x8;
Event.ENTITY_INITIALIZED = 0x9;
Event.GET_RUNTIME = 0xa;
Event.GET_WINDOW_SIZE = 0xb;
Event.GRAPHICS_COMPONENT_INITIALIZED = 0xc;
Event.IMAGE_COMPONENT_INITIALIZED = 0xd;
Event.IMAGE_INITIALIZED = 0xe;
Event.INPUT_COMPONENT_INITIALIZED = 0xf;
Event.INSTANCE_CREATED = 0x10;
Event.INSTANCE_DISPOSED = 0x11;
Event.KEYBOARD_DOWN = 0x12;
Event.KEYBOARD_UP = 0x13;
Event.MOUSE_DOWN = 0x14;
Event.MOUSE_MOVE = 0x15;
Event.MOUSE_UP = 0x16;
Event.MOUSE_WHEEL = 0x17;
Event.OBJECT_CREATED = 0x18;
Event.OBJECT_INITIALIZED = 0x19;
Event.PAUSE = 0x1a;
Event.PROJECT_INITIALIZED = 0x1b;
Event.RESTART = 0x1c;
Event.START = 0x1d;
Event.TOUCH_CANCEL = 0x1e;
Event.TOUCH_END = 0x1f;
Event.TOUCH_MOVE = 0x20;
Event.TOUCH_START = 0x21;
Event.UPDATE_FROM_INSTANCE_AFTER = 0x22;
Event.UPDATE_FROM_INSTANCE_BEFORE = 0x23;
Event.UPDATE_INSTANCE_AFTER = 0x24;
Event.UPDATE_INSTANCE_BEFORE = 0x25;
Event.UPDATE_INSTANCE_PROPERTY = 0x26;
Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x27;
Event.MAX_EVENTS = 0x28;
Event.COMPONENT_CREATED = 0x1;
Event.COMPONENT_INITIALIZED = 0x2;
Event.CREATE_INSTANCE_BEFORE = 0x3;
Event.DISPOSE_INSTANCE = 0x4;
Event.DISPOSE_OBJECT = 0x5;
Event.DOM_COMPONENT_INITIALIZED = 0x6;
Event.ENTITY_CREATED = 0x7;
Event.ENTITY_INITIALIZED = 0x8;
Event.GET_RUNTIME = 0x9;
Event.GET_WINDOW_SIZE = 0xa;
Event.GRAPHICS_COMPONENT_INITIALIZED = 0xb;
Event.IMAGE_COMPONENT_INITIALIZED = 0xc;
Event.IMAGE_INITIALIZED = 0xd;
Event.INPUT_COMPONENT_INITIALIZED = 0xe;
Event.INSTANCE_CREATED = 0xf;
Event.INSTANCE_DISPOSED = 0x10;
Event.KEYBOARD_DOWN = 0x11;
Event.KEYBOARD_UP = 0x12;
Event.MOUSE_DOWN = 0x13;
Event.MOUSE_MOVE = 0x14;
Event.MOUSE_UP = 0x15;
Event.MOUSE_WHEEL = 0x16;
Event.OBJECT_CREATED = 0x17;
Event.OBJECT_INITIALIZED = 0x18;
Event.PAUSE = 0x19;
Event.PROJECT_INITIALIZED = 0x1a;
Event.RESTART = 0x1b;
Event.START = 0x1c;
Event.TOUCH_CANCEL = 0x1d;
Event.TOUCH_END = 0x1e;
Event.TOUCH_MOVE = 0x1f;
Event.TOUCH_START = 0x20;
Event.UPDATE_FROM_INSTANCE_AFTER = 0x21;
Event.UPDATE_FROM_INSTANCE_BEFORE = 0x22;
Event.UPDATE_INSTANCE_AFTER = 0x23;
Event.UPDATE_INSTANCE_BEFORE = 0x24;
Event.UPDATE_INSTANCE_PROPERTY = 0x25;
Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x26;
Event.MAX_EVENTS = 0x27;
Event.GetEventName = function(eventId) {
switch(eventId) {
case 0x1 : return 'before_render';
case 0x2 : return 'component_created';
case 0x3 : return 'component_initialized';
case 0x4 : return 'create_instance_before';
case 0x5 : return 'dispose_instance';
case 0x6 : return 'dispose_object';
case 0x7 : return 'dom_component_initialized';
case 0x8 : return 'entity_created';
case 0x9 : return 'entity_initialized';
case 0xa : return 'get_runtime';
case 0xb : return 'get_window_size';
case 0xc : return 'graphics_component_initialized';
case 0xd : return 'image_component_initialized';
case 0xe : return 'image_initialized';
case 0xf : return 'input_component_initialized';
case 0x10 : return 'instance_created';
case 0x11 : return 'instance_disposed';
case 0x12 : return 'keyboard_down';
case 0x13 : return 'keyboard_up';
case 0x14 : return 'mouse_down';
case 0x15 : return 'mouse_move';
case 0x16 : return 'mouse_up';
case 0x17 : return 'mouse_wheel';
case 0x18 : return 'object_created';
case 0x19 : return 'object_initialized';
case 0x1a : return 'pause';
case 0x1b : return 'project_initialized';
case 0x1c : return 'restart';
case 0x1d : return 'start';
case 0x1e : return 'touch_cancel';
case 0x1f : return 'touch_end';
case 0x20 : return 'touch_move';
case 0x21 : return 'touch_start';
case 0x22 : return 'update_from_instance_after';
case 0x23 : return 'update_from_instance_before';
case 0x24 : return 'update_instance_after';
case 0x25 : return 'update_instance_before';
case 0x26 : return 'update_instance_property';
case 0x27 : return 'update_property_from_instance';
case 0x1 : return 'component_created';
case 0x2 : return 'component_initialized';
case 0x3 : return 'create_instance_before';
case 0x4 : return 'dispose_instance';
case 0x5 : return 'dispose_object';
case 0x6 : return 'dom_component_initialized';
case 0x7 : return 'entity_created';
case 0x8 : return 'entity_initialized';
case 0x9 : return 'get_runtime';
case 0xa : return 'get_window_size';
case 0xb : return 'graphics_component_initialized';
case 0xc : return 'image_component_initialized';
case 0xd : return 'image_initialized';
case 0xe : return 'input_component_initialized';
case 0xf : return 'instance_created';
case 0x10 : return 'instance_disposed';
case 0x11 : return 'keyboard_down';
case 0x12 : return 'keyboard_up';
case 0x13 : return 'mouse_down';
case 0x14 : return 'mouse_move';
case 0x15 : return 'mouse_up';
case 0x16 : return 'mouse_wheel';
case 0x17 : return 'object_created';
case 0x18 : return 'object_initialized';
case 0x19 : return 'pause';
case 0x1a : return 'project_initialized';
case 0x1b : return 'restart';
case 0x1c : return 'start';
case 0x1d : return 'touch_cancel';
case 0x1e : return 'touch_end';
case 0x1f : return 'touch_move';
case 0x20 : return 'touch_start';
case 0x21 : return 'update_from_instance_after';
case 0x22 : return 'update_from_instance_before';
case 0x23 : return 'update_instance_after';
case 0x24 : return 'update_instance_before';
case 0x25 : return 'update_instance_property';
case 0x26 : return 'update_property_from_instance';
default :
throw new Error('Event type not defined : ' + eventId);
}
@ -2384,6 +2382,8 @@ class R3Object extends Event {
Object.assign(this, options);
this.emit(Event.OBJECT_CREATED, this);
if (options.callDepth === 0) {
this.initialize();
} else {
@ -2857,11 +2857,22 @@ class Component extends R3Object {
if (delayInstance === true) {
console.log('Instance creation delayed for ' + this.name);
} else {
/**
* Set the runtime
*/
this.setRuntime();
/**
* Let the runtime build the instance
*/
this.instance = this.runtime.buildInstance(this);
/**
* Notify anyone who might be interested
*/
this.emit(Event.INSTANCE_CREATED, this);
}
}
}.bind(this)
);
}

View File

@ -1,6 +1,6 @@
{
"name": "r3",
"version" : "2.0.784",
"version" : "2.0.788",
"description": "",
"private": true,
"dependencies": {

7
r3.php
View File

@ -745,6 +745,7 @@ function getEventListenerInfo($item)
return [
'eventName' => $eventName,
'fullEventName' => 'Event.'.$eventName,
'returns' => $returns,
'comment' => $comment,
'methodName' => $methodName,
@ -773,7 +774,7 @@ function generateEventListenersStart($file, $tokens)
$info = getEventListenerInfo($item);
$updates = str_replace('FULL_EVENT_NAME', 'Event.' . $info['eventName'], $template);
$updates = str_replace('FULL_EVENT_NAME', $info['fullEventName'], $template);
$updates = str_replace('EVENT_NAME', $info['eventName'], $updates);
$updates = str_replace('CALL_BACK', $info['methodName'], $updates);
@ -831,7 +832,7 @@ function generateStaticEventListenersStart($file, $tokens)
$info = getEventListenerInfo($item);
$updates = str_replace('FULL_EVENT_NAME', 'Event.' . $info['eventName'], $template);
$updates = str_replace('FULL_EVENT_NAME', $info['fullEventName'], $template);
$updates = str_replace('EVENT_NAME', $info['eventName'], $updates);
$updates = str_replace('CALL_BACK', $info['methodName'], $updates);
@ -1100,7 +1101,7 @@ function getStaticEventListenerUpdates($template, $tokens, $token)
$updated = str_replace('METHOD_NAME', $info['methodName'], $updated);
$updated = str_replace('METHOD_ARGS', $methodArgs, $updated);
$comment = 'Listens to events of type ' . $info['eventName'] . ' and executes this function. ' . $info['comment'];
$comment = 'Listens to events of type ' . $info['fullEventName'] . ' and executes this function. ' . $info['comment'];
$comment = wordwrap($comment, 110, "\n * ");
$returns = wordwrap($returns, 110, "\n * ");

View File

@ -215,14 +215,23 @@ class Component extends R3Object {
if (delayInstance === true) {
console.log('Instance creation delayed for ' + this.name);
} else {
/**
* Set the runtime
*/
this.setRuntime();
/**
* Let the runtime build the instance
*/
this.instance = this.runtime.buildInstance(this);
/**
* Notify anyone who might be interested
*/
this.emit(Event.INSTANCE_CREATED, this);
}
}
}.bind(this)
);
//GENERATED_CREATE_INSTANCE_METHOD_END
//CUSTOM_CREATE_INSTANCE_METHOD_START

View File

@ -336,89 +336,87 @@ class Event {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//GENERATED_EVENTS_START
Event.BEFORE_RENDER = 0x1;
Event.COMPONENT_CREATED = 0x2;
Event.COMPONENT_INITIALIZED = 0x3;
Event.CREATE_INSTANCE_BEFORE = 0x4;
Event.DISPOSE_INSTANCE = 0x5;
Event.DISPOSE_OBJECT = 0x6;
Event.DOM_COMPONENT_INITIALIZED = 0x7;
Event.ENTITY_CREATED = 0x8;
Event.ENTITY_INITIALIZED = 0x9;
Event.GET_RUNTIME = 0xa;
Event.GET_WINDOW_SIZE = 0xb;
Event.GRAPHICS_COMPONENT_INITIALIZED = 0xc;
Event.IMAGE_COMPONENT_INITIALIZED = 0xd;
Event.IMAGE_INITIALIZED = 0xe;
Event.INPUT_COMPONENT_INITIALIZED = 0xf;
Event.INSTANCE_CREATED = 0x10;
Event.INSTANCE_DISPOSED = 0x11;
Event.KEYBOARD_DOWN = 0x12;
Event.KEYBOARD_UP = 0x13;
Event.MOUSE_DOWN = 0x14;
Event.MOUSE_MOVE = 0x15;
Event.MOUSE_UP = 0x16;
Event.MOUSE_WHEEL = 0x17;
Event.OBJECT_CREATED = 0x18;
Event.OBJECT_INITIALIZED = 0x19;
Event.PAUSE = 0x1a;
Event.PROJECT_INITIALIZED = 0x1b;
Event.RESTART = 0x1c;
Event.START = 0x1d;
Event.TOUCH_CANCEL = 0x1e;
Event.TOUCH_END = 0x1f;
Event.TOUCH_MOVE = 0x20;
Event.TOUCH_START = 0x21;
Event.UPDATE_FROM_INSTANCE_AFTER = 0x22;
Event.UPDATE_FROM_INSTANCE_BEFORE = 0x23;
Event.UPDATE_INSTANCE_AFTER = 0x24;
Event.UPDATE_INSTANCE_BEFORE = 0x25;
Event.UPDATE_INSTANCE_PROPERTY = 0x26;
Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x27;
Event.MAX_EVENTS = 0x28;
Event.COMPONENT_CREATED = 0x1;
Event.COMPONENT_INITIALIZED = 0x2;
Event.CREATE_INSTANCE_BEFORE = 0x3;
Event.DISPOSE_INSTANCE = 0x4;
Event.DISPOSE_OBJECT = 0x5;
Event.DOM_COMPONENT_INITIALIZED = 0x6;
Event.ENTITY_CREATED = 0x7;
Event.ENTITY_INITIALIZED = 0x8;
Event.GET_RUNTIME = 0x9;
Event.GET_WINDOW_SIZE = 0xa;
Event.GRAPHICS_COMPONENT_INITIALIZED = 0xb;
Event.IMAGE_COMPONENT_INITIALIZED = 0xc;
Event.IMAGE_INITIALIZED = 0xd;
Event.INPUT_COMPONENT_INITIALIZED = 0xe;
Event.INSTANCE_CREATED = 0xf;
Event.INSTANCE_DISPOSED = 0x10;
Event.KEYBOARD_DOWN = 0x11;
Event.KEYBOARD_UP = 0x12;
Event.MOUSE_DOWN = 0x13;
Event.MOUSE_MOVE = 0x14;
Event.MOUSE_UP = 0x15;
Event.MOUSE_WHEEL = 0x16;
Event.OBJECT_CREATED = 0x17;
Event.OBJECT_INITIALIZED = 0x18;
Event.PAUSE = 0x19;
Event.PROJECT_INITIALIZED = 0x1a;
Event.RESTART = 0x1b;
Event.START = 0x1c;
Event.TOUCH_CANCEL = 0x1d;
Event.TOUCH_END = 0x1e;
Event.TOUCH_MOVE = 0x1f;
Event.TOUCH_START = 0x20;
Event.UPDATE_FROM_INSTANCE_AFTER = 0x21;
Event.UPDATE_FROM_INSTANCE_BEFORE = 0x22;
Event.UPDATE_INSTANCE_AFTER = 0x23;
Event.UPDATE_INSTANCE_BEFORE = 0x24;
Event.UPDATE_INSTANCE_PROPERTY = 0x25;
Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x26;
Event.MAX_EVENTS = 0x27;
Event.GetEventName = function(eventId) {
switch(eventId) {
case 0x1 : return 'before_render';
case 0x2 : return 'component_created';
case 0x3 : return 'component_initialized';
case 0x4 : return 'create_instance_before';
case 0x5 : return 'dispose_instance';
case 0x6 : return 'dispose_object';
case 0x7 : return 'dom_component_initialized';
case 0x8 : return 'entity_created';
case 0x9 : return 'entity_initialized';
case 0xa : return 'get_runtime';
case 0xb : return 'get_window_size';
case 0xc : return 'graphics_component_initialized';
case 0xd : return 'image_component_initialized';
case 0xe : return 'image_initialized';
case 0xf : return 'input_component_initialized';
case 0x10 : return 'instance_created';
case 0x11 : return 'instance_disposed';
case 0x12 : return 'keyboard_down';
case 0x13 : return 'keyboard_up';
case 0x14 : return 'mouse_down';
case 0x15 : return 'mouse_move';
case 0x16 : return 'mouse_up';
case 0x17 : return 'mouse_wheel';
case 0x18 : return 'object_created';
case 0x19 : return 'object_initialized';
case 0x1a : return 'pause';
case 0x1b : return 'project_initialized';
case 0x1c : return 'restart';
case 0x1d : return 'start';
case 0x1e : return 'touch_cancel';
case 0x1f : return 'touch_end';
case 0x20 : return 'touch_move';
case 0x21 : return 'touch_start';
case 0x22 : return 'update_from_instance_after';
case 0x23 : return 'update_from_instance_before';
case 0x24 : return 'update_instance_after';
case 0x25 : return 'update_instance_before';
case 0x26 : return 'update_instance_property';
case 0x27 : return 'update_property_from_instance';
case 0x1 : return 'component_created';
case 0x2 : return 'component_initialized';
case 0x3 : return 'create_instance_before';
case 0x4 : return 'dispose_instance';
case 0x5 : return 'dispose_object';
case 0x6 : return 'dom_component_initialized';
case 0x7 : return 'entity_created';
case 0x8 : return 'entity_initialized';
case 0x9 : return 'get_runtime';
case 0xa : return 'get_window_size';
case 0xb : return 'graphics_component_initialized';
case 0xc : return 'image_component_initialized';
case 0xd : return 'image_initialized';
case 0xe : return 'input_component_initialized';
case 0xf : return 'instance_created';
case 0x10 : return 'instance_disposed';
case 0x11 : return 'keyboard_down';
case 0x12 : return 'keyboard_up';
case 0x13 : return 'mouse_down';
case 0x14 : return 'mouse_move';
case 0x15 : return 'mouse_up';
case 0x16 : return 'mouse_wheel';
case 0x17 : return 'object_created';
case 0x18 : return 'object_initialized';
case 0x19 : return 'pause';
case 0x1a : return 'project_initialized';
case 0x1b : return 'restart';
case 0x1c : return 'start';
case 0x1d : return 'touch_cancel';
case 0x1e : return 'touch_end';
case 0x1f : return 'touch_move';
case 0x20 : return 'touch_start';
case 0x21 : return 'update_from_instance_after';
case 0x22 : return 'update_from_instance_before';
case 0x23 : return 'update_instance_after';
case 0x24 : return 'update_instance_before';
case 0x25 : return 'update_instance_property';
case 0x26 : return 'update_property_from_instance';
default :
throw new Error('Event type not defined : ' + eventId);
}

View File

@ -148,6 +148,7 @@ class R3Object extends Event {
Object.assign(this, options);
//CUSTOM_BEFORE_INIT_START
this.emit(Event.OBJECT_CREATED, this);
//CUSTOM_BEFORE_INIT_END
if (options.callDepth === 0) {

View File

@ -1,6 +1,6 @@
class R3 {
static version = '2.0.784';
static compileDate = '2021 Sep 19 - 21:28:13 pm';
static version = '2.0.788';
static compileDate = '2021 Sep 19 - 21:34:33 pm';
}
//GENERATED_IMPORTS_START

View File

@ -188,9 +188,9 @@ class SystemDOM extends System {
/**
* OnDomComponentInitialized()
* - Listens to events of type Event.DOM_COMPONENT_INITIALIZED and executes this function.
* - Listens to events of type Event.DOM_COMPONENT_INITIALIZED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnDomComponentInitialized(object) {

View File

@ -269,9 +269,9 @@ class SystemInput extends System {
/**
* OnTouchStart()
* - Listens to events of type Event.TOUCH_START and executes this function.
* - Listens to events of type Event.TOUCH_START and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnTouchStart(object) {
@ -285,9 +285,9 @@ class SystemInput extends System {
/**
* OnTouchEnd()
* - Listens to events of type Event.TOUCH_END and executes this function.
* - Listens to events of type Event.TOUCH_END and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnTouchEnd(object) {
@ -301,9 +301,9 @@ class SystemInput extends System {
/**
* OnTouchMove()
* - Listens to events of type Event.TOUCH_MOVE and executes this function.
* - Listens to events of type Event.TOUCH_MOVE and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnTouchMove(object) {
@ -317,9 +317,9 @@ class SystemInput extends System {
/**
* OnTouchCancel()
* - Listens to events of type Event.TOUCH_CANCEL and executes this function.
* - Listens to events of type Event.TOUCH_CANCEL and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnTouchCancel(object) {
@ -333,9 +333,9 @@ class SystemInput extends System {
/**
* OnKeyboardDown()
* - Listens to events of type Event.KEYBOARD_DOWN and executes this function.
* - Listens to events of type Event.KEYBOARD_DOWN and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnKeyboardDown(object) {
@ -349,9 +349,9 @@ class SystemInput extends System {
/**
* OnKeyboardUp()
* - Listens to events of type Event.KEYBOARD_UP and executes this function.
* - Listens to events of type Event.KEYBOARD_UP and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnKeyboardUp(object) {
@ -365,9 +365,9 @@ class SystemInput extends System {
/**
* OnMouseDown()
* - Listens to events of type Event.MOUSE_DOWN and executes this function.
* - Listens to events of type Event.MOUSE_DOWN and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnMouseDown(object) {
@ -381,9 +381,9 @@ class SystemInput extends System {
/**
* OnMouseUp()
* - Listens to events of type Event.MOUSE_UP and executes this function.
* - Listens to events of type Event.MOUSE_UP and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnMouseUp(object) {
@ -397,9 +397,9 @@ class SystemInput extends System {
/**
* OnMouseMove()
* - Listens to events of type Event.MOUSE_MOVE and executes this function.
* - Listens to events of type Event.MOUSE_MOVE and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnMouseMove(object) {
@ -413,9 +413,9 @@ class SystemInput extends System {
/**
* OnMouseWheel()
* - Listens to events of type Event.MOUSE_WHEEL and executes this function.
* - Listens to events of type Event.MOUSE_WHEEL and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnMouseWheel(object) {

View File

@ -217,7 +217,7 @@ class SystemLinking extends System {
/**
* OnObjectCreated()
* - Listens to events of type OBJECT_CREATED and executes this function.
* - Listens to events of type Event.OBJECT_CREATED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return
*/
@ -234,7 +234,7 @@ class SystemLinking extends System {
/**
* OnObjectInitialized()
* - Listens to events of type OBJECT_INITIALIZED and executes this function.
* - Listens to events of type Event.OBJECT_INITIALIZED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return
*/
@ -251,7 +251,7 @@ class SystemLinking extends System {
/**
* OnInstanceCreated()
* - Listens to events of type INSTANCE_CREATED and executes this function.
* - Listens to events of type Event.INSTANCE_CREATED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return
*/
@ -268,7 +268,7 @@ class SystemLinking extends System {
/**
* OnCreateInstanceBefore()
* - Listens to events of type CREATE_INSTANCE_BEFORE and executes this function.
* - Listens to events of type Event.CREATE_INSTANCE_BEFORE and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return boolean delayInstance which indicates whether or not instance creation is delayed (handled) by
* another system. (i.e. where instance creation order is of importance)

View File

@ -188,9 +188,9 @@ class SystemRender extends System {
/**
* OnInstanceCreated()
* - Listens to events of type Event.INSTANCE_CREATED and executes this function.
* - Listens to events of type Event.INSTANCE_CREATED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnInstanceCreated(object) {

View File

@ -212,9 +212,9 @@ class SystemRuntime extends System {
/**
* OnGetRuntime()
* - Listens to events of type Event.GET_RUNTIME and executes this function.
* - Listens to events of type Event.GET_RUNTIME and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnGetRuntime(object) {
@ -245,9 +245,9 @@ class SystemRuntime extends System {
/**
* OnProjectInitialized()
* - Listens to events of type Event.PROJECT_INITIALIZED and executes this function.
* - Listens to events of type Event.PROJECT_INITIALIZED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnProjectInitialized(object) {

View File

@ -188,9 +188,9 @@ class SystemStorage extends System {
/**
* OnImageComponentInitialized()
* - Listens to events of type Event.IMAGE_COMPONENT_INITIALIZED and executes this function.
* - Listens to events of type Event.IMAGE_COMPONENT_INITIALIZED and executes this function.
* @param object (The event data passed as argument - typically an R3Object)
* @return null
* @return
*/
static OnImageComponentInitialized(object) {

View File

@ -20,5 +20,5 @@
*/
this.emit(Event.INSTANCE_CREATED, this);
}
}
}.bind(this)
);

View File

@ -1 +1 @@
2.0.784
2.0.788