diff --git a/dist/r3.js b/dist/r3.js index f751c36..4840f71 100644 --- a/dist/r3.js +++ b/dist/r3.js @@ -1,12 +1,33 @@ class R3 { - static version = '2.0.652'; - static compileDate = '2021 Sep 13 - 09:52:18 am'; + static version = '2.0.654'; + static compileDate = '2021 Sep 13 - 09:56:59 am'; } +/** + + TEMPLATE_OPTIONS_START + TEMPLATE_OPTIONS_END + + TEMPLATE_STATIC_OPTIONS_START + TEMPLATE_STATIC_OPTIONS_END + + TEMPLATE_METHODS_START + TEMPLATE_METHODS_END + + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + + **/ + class Runtime { - constructor() { + constructor(options) { + if (typeof options === 'undefined') { + options = {}; + } + + Object.assign(this, options); } } @@ -304,83 +325,85 @@ class Event { } -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.INPUT_COMPONENT_INITIALIZED = 0xc; -Event.INSTANCE_CREATED = 0xd; -Event.INSTANCE_DISPOSED = 0xe; -Event.KEYBOARD_DOWN = 0xf; -Event.KEYBOARD_UP = 0x10; -Event.MOUSE_DOWN = 0x11; -Event.MOUSE_MOVE = 0x12; -Event.MOUSE_UP = 0x13; -Event.MOUSE_WHEEL = 0x14; -Event.OBJECT_CREATED = 0x15; -Event.OBJECT_INITIALIZED = 0x16; -Event.PAUSE = 0x17; -Event.PROJECT_INITIALIZED = 0x18; -Event.RESTART = 0x19; -Event.START = 0x1a; -Event.TOUCH_CANCEL = 0x1b; -Event.TOUCH_END = 0x1c; -Event.TOUCH_MOVE = 0x1d; -Event.TOUCH_START = 0x1e; -Event.UPDATE_FROM_INSTANCE_AFTER = 0x1f; -Event.UPDATE_FROM_INSTANCE_BEFORE = 0x20; -Event.UPDATE_INSTANCE_AFTER = 0x21; -Event.UPDATE_INSTANCE_BEFORE = 0x22; -Event.UPDATE_INSTANCE_PROPERTY = 0x23; -Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x24; -Event.MAX_EVENTS = 0x25; +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.INPUT_COMPONENT_INITIALIZED = 0xd; +Event.INSTANCE_CREATED = 0xe; +Event.INSTANCE_DISPOSED = 0xf; +Event.KEYBOARD_DOWN = 0x10; +Event.KEYBOARD_UP = 0x11; +Event.MOUSE_DOWN = 0x12; +Event.MOUSE_MOVE = 0x13; +Event.MOUSE_UP = 0x14; +Event.MOUSE_WHEEL = 0x15; +Event.OBJECT_CREATED = 0x16; +Event.OBJECT_INITIALIZED = 0x17; +Event.PAUSE = 0x18; +Event.PROJECT_INITIALIZED = 0x19; +Event.RESTART = 0x1a; +Event.START = 0x1b; +Event.TOUCH_CANCEL = 0x1c; +Event.TOUCH_END = 0x1d; +Event.TOUCH_MOVE = 0x1e; +Event.TOUCH_START = 0x1f; +Event.UPDATE_FROM_INSTANCE_AFTER = 0x20; +Event.UPDATE_FROM_INSTANCE_BEFORE = 0x21; +Event.UPDATE_INSTANCE_AFTER = 0x22; +Event.UPDATE_INSTANCE_BEFORE = 0x23; +Event.UPDATE_INSTANCE_PROPERTY = 0x24; +Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x25; +Event.MAX_EVENTS = 0x26; Event.GetEventName = function(eventId) { switch(eventId) { - 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 'input_component_initialized'; - case 0xd : return 'instance_created'; - case 0xe : return 'instance_disposed'; - case 0xf : return 'keyboard_down'; - case 0x10 : return 'keyboard_up'; - case 0x11 : return 'mouse_down'; - case 0x12 : return 'mouse_move'; - case 0x13 : return 'mouse_up'; - case 0x14 : return 'mouse_wheel'; - case 0x15 : return 'object_created'; - case 0x16 : return 'object_initialized'; - case 0x17 : return 'pause'; - case 0x18 : return 'project_initialized'; - case 0x19 : return 'restart'; - case 0x1a : return 'start'; - case 0x1b : return 'touch_cancel'; - case 0x1c : return 'touch_end'; - case 0x1d : return 'touch_move'; - case 0x1e : return 'touch_start'; - case 0x1f : return 'update_from_instance_after'; - case 0x20 : return 'update_from_instance_before'; - case 0x21 : return 'update_instance_after'; - case 0x22 : return 'update_instance_before'; - case 0x23 : return 'update_instance_property'; - case 0x24 : return 'update_property_from_instance'; + 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 'input_component_initialized'; + case 0xe : return 'instance_created'; + case 0xf : return 'instance_disposed'; + case 0x10 : return 'keyboard_down'; + case 0x11 : return 'keyboard_up'; + case 0x12 : return 'mouse_down'; + case 0x13 : return 'mouse_move'; + case 0x14 : return 'mouse_up'; + case 0x15 : return 'mouse_wheel'; + case 0x16 : return 'object_created'; + case 0x17 : return 'object_initialized'; + case 0x18 : return 'pause'; + case 0x19 : return 'project_initialized'; + case 0x1a : return 'restart'; + case 0x1b : return 'start'; + case 0x1c : return 'touch_cancel'; + case 0x1d : return 'touch_end'; + case 0x1e : return 'touch_move'; + case 0x1f : return 'touch_start'; + case 0x20 : return 'update_from_instance_after'; + case 0x21 : return 'update_from_instance_before'; + case 0x22 : return 'update_instance_after'; + case 0x23 : return 'update_instance_before'; + case 0x24 : return 'update_instance_property'; + case 0x25 : return 'update_property_from_instance'; default : throw new Error('Event type not defined : ' + eventId); } diff --git a/package.json b/package.json index bee7358..e09113d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "r3", - "version" : "2.0.652", + "version" : "2.0.654", "description": "", "private": true, "dependencies": { diff --git a/src/r3/r3-event.js b/src/r3/r3-event.js index 1b4dbdd..7adb92a 100644 --- a/src/r3/r3-event.js +++ b/src/r3/r3-event.js @@ -342,83 +342,85 @@ class Event { //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_EVENTS_START -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.INPUT_COMPONENT_INITIALIZED = 0xc; -Event.INSTANCE_CREATED = 0xd; -Event.INSTANCE_DISPOSED = 0xe; -Event.KEYBOARD_DOWN = 0xf; -Event.KEYBOARD_UP = 0x10; -Event.MOUSE_DOWN = 0x11; -Event.MOUSE_MOVE = 0x12; -Event.MOUSE_UP = 0x13; -Event.MOUSE_WHEEL = 0x14; -Event.OBJECT_CREATED = 0x15; -Event.OBJECT_INITIALIZED = 0x16; -Event.PAUSE = 0x17; -Event.PROJECT_INITIALIZED = 0x18; -Event.RESTART = 0x19; -Event.START = 0x1a; -Event.TOUCH_CANCEL = 0x1b; -Event.TOUCH_END = 0x1c; -Event.TOUCH_MOVE = 0x1d; -Event.TOUCH_START = 0x1e; -Event.UPDATE_FROM_INSTANCE_AFTER = 0x1f; -Event.UPDATE_FROM_INSTANCE_BEFORE = 0x20; -Event.UPDATE_INSTANCE_AFTER = 0x21; -Event.UPDATE_INSTANCE_BEFORE = 0x22; -Event.UPDATE_INSTANCE_PROPERTY = 0x23; -Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x24; -Event.MAX_EVENTS = 0x25; +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.INPUT_COMPONENT_INITIALIZED = 0xd; +Event.INSTANCE_CREATED = 0xe; +Event.INSTANCE_DISPOSED = 0xf; +Event.KEYBOARD_DOWN = 0x10; +Event.KEYBOARD_UP = 0x11; +Event.MOUSE_DOWN = 0x12; +Event.MOUSE_MOVE = 0x13; +Event.MOUSE_UP = 0x14; +Event.MOUSE_WHEEL = 0x15; +Event.OBJECT_CREATED = 0x16; +Event.OBJECT_INITIALIZED = 0x17; +Event.PAUSE = 0x18; +Event.PROJECT_INITIALIZED = 0x19; +Event.RESTART = 0x1a; +Event.START = 0x1b; +Event.TOUCH_CANCEL = 0x1c; +Event.TOUCH_END = 0x1d; +Event.TOUCH_MOVE = 0x1e; +Event.TOUCH_START = 0x1f; +Event.UPDATE_FROM_INSTANCE_AFTER = 0x20; +Event.UPDATE_FROM_INSTANCE_BEFORE = 0x21; +Event.UPDATE_INSTANCE_AFTER = 0x22; +Event.UPDATE_INSTANCE_BEFORE = 0x23; +Event.UPDATE_INSTANCE_PROPERTY = 0x24; +Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x25; +Event.MAX_EVENTS = 0x26; Event.GetEventName = function(eventId) { switch(eventId) { - 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 'input_component_initialized'; - case 0xd : return 'instance_created'; - case 0xe : return 'instance_disposed'; - case 0xf : return 'keyboard_down'; - case 0x10 : return 'keyboard_up'; - case 0x11 : return 'mouse_down'; - case 0x12 : return 'mouse_move'; - case 0x13 : return 'mouse_up'; - case 0x14 : return 'mouse_wheel'; - case 0x15 : return 'object_created'; - case 0x16 : return 'object_initialized'; - case 0x17 : return 'pause'; - case 0x18 : return 'project_initialized'; - case 0x19 : return 'restart'; - case 0x1a : return 'start'; - case 0x1b : return 'touch_cancel'; - case 0x1c : return 'touch_end'; - case 0x1d : return 'touch_move'; - case 0x1e : return 'touch_start'; - case 0x1f : return 'update_from_instance_after'; - case 0x20 : return 'update_from_instance_before'; - case 0x21 : return 'update_instance_after'; - case 0x22 : return 'update_instance_before'; - case 0x23 : return 'update_instance_property'; - case 0x24 : return 'update_property_from_instance'; + 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 'input_component_initialized'; + case 0xe : return 'instance_created'; + case 0xf : return 'instance_disposed'; + case 0x10 : return 'keyboard_down'; + case 0x11 : return 'keyboard_up'; + case 0x12 : return 'mouse_down'; + case 0x13 : return 'mouse_move'; + case 0x14 : return 'mouse_up'; + case 0x15 : return 'mouse_wheel'; + case 0x16 : return 'object_created'; + case 0x17 : return 'object_initialized'; + case 0x18 : return 'pause'; + case 0x19 : return 'project_initialized'; + case 0x1a : return 'restart'; + case 0x1b : return 'start'; + case 0x1c : return 'touch_cancel'; + case 0x1d : return 'touch_end'; + case 0x1e : return 'touch_move'; + case 0x1f : return 'touch_start'; + case 0x20 : return 'update_from_instance_after'; + case 0x21 : return 'update_from_instance_before'; + case 0x22 : return 'update_instance_after'; + case 0x23 : return 'update_instance_before'; + case 0x24 : return 'update_instance_property'; + case 0x25 : return 'update_property_from_instance'; default : throw new Error('Event type not defined : ' + eventId); } diff --git a/src/r3/r3-r3.js b/src/r3/r3-r3.js index 8bef6d0..afcdb75 100644 --- a/src/r3/r3-r3.js +++ b/src/r3/r3-r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '2.0.652'; - static compileDate = '2021 Sep 13 - 09:52:18 am'; + static version = '2.0.654'; + static compileDate = '2021 Sep 13 - 09:56:59 am'; } //GENERATED_IMPORTS_START diff --git a/src/r3/r3-runtime/r3-runtime.js b/src/r3/r3-runtime/r3-runtime.js index cf40d53..a1cf6e0 100644 --- a/src/r3/r3-runtime/r3-runtime.js +++ b/src/r3/r3-runtime/r3-runtime.js @@ -3,30 +3,73 @@ const Utils = require('.././r3-utils'); /** + TEMPLATE_OPTIONS_START + TEMPLATE_OPTIONS_END + CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + TEMPLATE_STATIC_OPTIONS_START + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_METHODS_START + TEMPLATE_METHODS_END + CUSTOM_METHODS_START CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + + CUSTOM_STATIC_METHODS_START + CUSTOM_STATIC_METHODS_END + **/ class Runtime { //GENERATED_CONSTRUCTOR_START - constructor() { + constructor(options) { + if (typeof options === 'undefined') { + options = {}; + } + + //GENERATED_TEMPLATE_OPTIONS_INIT_START + //GENERATED_TEMPLATE_OPTIONS_INIT_END + + //GENERATED_OPTIONS_INIT_START + //GENERATED_OPTIONS_INIT_END + + Object.assign(this, options); } //GENERATED_CONSTRUCTOR_END + //GENERATED_TEMPLATE_METHODS_START + //GENERATED_TEMPLATE_METHODS_END + //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + + //GENERATED_STATIC_METHODS_START + //GENERATED_STATIC_METHODS_END + //CUSTOM_IMPLEMENTATION_START //CUSTOM_IMPLEMENTATION_END - } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START Runtime.RUNTIME_BULLET = 0x0; Runtime.RUNTIME_CODER = 0x1; diff --git a/src/templates/runtime_base.template b/src/templates/runtime_base.template index 1bf86d9..d5e1de1 100644 --- a/src/templates/runtime_base.template +++ b/src/templates/runtime_base.template @@ -3,12 +3,30 @@ const Utils = require('INCLUDE_PATH/r3-utils'); /** + TEMPLATE_OPTIONS_START + TEMPLATE_OPTIONS_END + CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + TEMPLATE_STATIC_OPTIONS_START + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_METHODS_START + TEMPLATE_METHODS_END + CUSTOM_METHODS_START CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + + CUSTOM_STATIC_METHODS_START + CUSTOM_STATIC_METHODS_END + **/ class CLASS_NAME { @@ -16,14 +34,28 @@ class CLASS_NAME { //GENERATED_CONSTRUCTOR_START //GENERATED_CONSTRUCTOR_END + //GENERATED_TEMPLATE_METHODS_START + //GENERATED_TEMPLATE_METHODS_END + //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + + //GENERATED_STATIC_METHODS_START + //GENERATED_STATIC_METHODS_END + //CUSTOM_IMPLEMENTATION_START //CUSTOM_IMPLEMENTATION_END - } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/templates/runtime_base_constructor.template b/src/templates/runtime_base_constructor.template index a4950ed..ee9fdb0 100644 --- a/src/templates/runtime_base_constructor.template +++ b/src/templates/runtime_base_constructor.template @@ -1,3 +1,14 @@ - constructor() { + constructor(options) { + if (typeof options === 'undefined') { + options = {}; + } + + //GENERATED_TEMPLATE_OPTIONS_INIT_START + //GENERATED_TEMPLATE_OPTIONS_INIT_END + + //GENERATED_OPTIONS_INIT_START + //GENERATED_OPTIONS_INIT_END + + Object.assign(this, options); } \ No newline at end of file diff --git a/version b/version index a404035..9f36407 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.0.652 \ No newline at end of file +2.0.654 \ No newline at end of file