From 534dd4ceb0e9baf90226214b2a5d3c60f84458ce Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Fri, 24 Sep 2021 07:05:41 +0200 Subject: [PATCH] fix other components --- .r3_history | 2 +- dist/index.html | 1 + dist/r3.js | 513 ++++++++----------- package.json | 2 +- src/r3/r3-component-code.js | 333 ------------ src/r3/r3-component/index.js | 4 +- src/r3/r3-component/r3-component-canvas.js | 2 +- src/r3/r3-component/r3-component-d-o-m.js | 2 +- src/r3/r3-component/r3-component-graphics.js | 2 +- src/r3/r3-component/r3-component-image.js | 2 +- src/r3/r3-component/r3-component-input.js | 2 +- src/r3/r3-component/r3-component-material.js | 2 +- src/r3/r3-component/r3-component-mesh.js | 2 +- src/r3/r3-component/r3-component-texture.js | 2 +- src/r3/r3-component/r3-component-touch.js | 2 +- src/r3/r3-component/r3-component.js | 20 +- src/r3/r3-project.js | 2 +- src/r3/r3-r3.js | 6 +- src/r3/r3-utils.js | 62 --- version | 2 +- 20 files changed, 255 insertions(+), 710 deletions(-) delete mode 100644 src/r3/r3-component-code.js diff --git a/.r3_history b/.r3_history index bd0675a..120880c 100644 --- a/.r3_history +++ b/.r3_history @@ -40,4 +40,4 @@ r3 create RuntimeImage runtime_base ./r3-runtime/ r3 create RuntimeWebImage runtime_extends RuntimeImage ./r3-runtime/ r3 create RuntimeNodeJSImage runtime_extends RuntimeImage ./r3-runtime/ r3 create Runtime base ./r3-runtime/ -r3 create ComponentCode component_extends Component +r3 create ComponentCode component_extends Component ./r3-component/ diff --git a/dist/index.html b/dist/index.html index 9d90f2d..fb69c6d 100644 --- a/dist/index.html +++ b/dist/index.html @@ -41,6 +41,7 @@ slider.canvas = null; slider.canvas = canvas; slider.images = []; + slider.images = [image]; }); diff --git a/dist/r3.js b/dist/r3.js index bc1d60a..e6cab09 100644 --- a/dist/r3.js +++ b/dist/r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '3.0.69'; - static compileDate = '2021 Sep 23 - 20:23:57 pm'; + static version = '3.0.73'; + static compileDate = '2021 Sep 24 - 07:04:55 am'; } class Runtime { @@ -3484,18 +3484,220 @@ class Component extends R3Object { } -Component.DOM = 0x0; -Component.CANVAS = 0x1; -Component.GRAPHICS = 0x2; -Component.IMAGE = 0x3; -Component.MATERIAL = 0x4; -Component.MESH = 0x5; -Component.TEXTURE = 0x6; -Component.INPUT = 0x7; -Component.TOUCH = 0x8; -Component.CODE = 0x9; +Component.CODE = 0x0; +Component.DOM = 0x1; +Component.CANVAS = 0x2; +Component.GRAPHICS = 0x3; +Component.IMAGE = 0x4; +Component.MATERIAL = 0x5; +Component.MESH = 0x6; +Component.TEXTURE = 0x7; +Component.INPUT = 0x8; +Component.TOUCH = 0x9; Component.MAX_COMPONENT = 0xa; +/** + + Class R3.Event.Object.Component.Code + [Inherited from Event] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - async(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Async()' passing it the arguments + + - emit(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Emit()' passing it the arguments + + - subscribe(eventId, callback) + Simply calls 'Subscribe()' passing it the arguments + + Inherited Static Methods: + + - Async(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as + arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the + error as argument. + + - Emit(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after + the event result is obtained, passing it the result. If an exception occurs during execution, the + clientErrorCallback is called with the error as argument. + + - Subscribe(eventId, callback) + Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised + + [Inherited from R3Object] + + Inherited Properties: + + - id (Default value Utils.RandomId(15) - Each Object receives an 15 digit random ID which uniquely + identifies it everywhere (client and server side)) + - name (Default value 'Object ' + options.id - Each Object has a name) + - parent (Default value null - All objects could have a parent) + - children (Default value [] - All objects could have some children) + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from Component] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to ComponentCode] + + Properties: + + + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + **/ + +class ComponentCode extends Component { + + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + if (typeof options.maxDepth === 'undefined') { + options.maxDepth = 0; + } + + if (typeof options.callDepth === 'undefined') { + options.callDepth = 0; + } else { + options.callDepth++; + } + + options.maxDepth = options.callDepth; + + /** + * initialized - A boolean which indicates whether or not this component has initialized + */ + if (typeof options.initialized === 'undefined') { + options.initialized = false; + } + /** + * instance - Holds the current instance of this object as determined (built) by the runtime object. + */ + if (typeof options.instance === 'undefined') { + options.instance = null; + } + /** + * initializeDepth - The amount of times this component passed through initialize() functions + */ + if (typeof options.initializeDepth === 'undefined') { + options.initializeDepth = 0; + } + + super(options); + + Object.assign(this, options); + + if (options.callDepth === 0) { + this.initialize(); + } else { + options.callDepth--; + } + + } + + /** + * initialize() + * - Notifies all systems listening that this component initialized. + */ + initialize() { + + super.initialize(); + + if (this.initializeDepth === this.maxDepth) { + + if (this instanceof R3.Component) { + this.createInstance(); + } + + if (this instanceof R3.Entity && this.initialized && !this.started) { + this.start(); + } + + } else { + this.initializeDepth++; + } + + } + + /** + * updateInstance() + * - Updates this object by copying the values of the current object into it's instance object. + * @param property + */ + updateInstance(property) { + + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + + } + + /** + * updateFromInstance() + * - Updates this object by copying the values of its instance into the current object. + * @param property + */ + updateFromInstance(property) { + + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + } + +} + /** Class R3.Event.Object.Component.DOM @@ -3670,7 +3872,7 @@ class ComponentDOM extends Component { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } @@ -3949,7 +4151,7 @@ class ComponentCanvas extends ComponentDOM { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } @@ -4239,7 +4441,7 @@ class ComponentGraphics extends Component { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } @@ -4568,7 +4770,7 @@ class ComponentImage extends ComponentGraphics { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } @@ -5014,7 +5216,7 @@ class ComponentMaterial extends ComponentGraphics { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } @@ -5234,7 +5436,7 @@ class ComponentMesh extends ComponentGraphics { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } @@ -5454,7 +5656,7 @@ class ComponentTexture extends ComponentGraphics { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } @@ -5658,7 +5860,7 @@ class ComponentInput extends Component { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } @@ -5878,209 +6080,7 @@ class ComponentTouch extends ComponentInput { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { - this.start(); - } - - } else { - this.initializeDepth++; - } - - } - - /** - * updateInstance() - * - Updates this object by copying the values of the current object into it's instance object. - * @param property - */ - updateInstance(property) { - - this.emit(Event.UPDATE_INSTANCE_BEFORE, this); - - this.emit(Event.UPDATE_INSTANCE_AFTER, this); - - } - - /** - * updateFromInstance() - * - Updates this object by copying the values of its instance into the current object. - * @param property - */ - updateFromInstance(property) { - - this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); - - this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); - - } - -} - -/** - - Class R3.Event.Object.Component.Code - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - async(eventId, data, clientCallback, clientErrorCallback) - Simply calls 'Async()' passing it the arguments - - - emit(eventId, data, clientCallback, clientErrorCallback) - Simply calls 'Emit()' passing it the arguments - - - subscribe(eventId, callback) - Simply calls 'Subscribe()' passing it the arguments - - Inherited Static Methods: - - - Async(eventId, data, clientCallback, clientErrorCallback) - Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as - arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the - error as argument. - - - Emit(eventId, data, clientCallback, clientErrorCallback) - Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after - the event result is obtained, passing it the result. If an exception occurs during execution, the - clientErrorCallback is called with the error as argument. - - - Subscribe(eventId, callback) - Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised - - [Inherited from R3Object] - - Inherited Properties: - - - id (Default value Utils.RandomId(15) - Each Object receives an 15 digit random ID which uniquely - identifies it everywhere (client and server side)) - - name (Default value 'Object ' + options.id - Each Object has a name) - - parent (Default value null - All objects could have a parent) - - children (Default value [] - All objects could have some children) - - Inherited Static Properties: - - - - Inherited Methods: - - - - Inherited Static Methods: - - - - [Inherited from Component] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - - Inherited Static Methods: - - - - [Belonging to ComponentCode] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class ComponentCode extends Component { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.maxDepth === 'undefined') { - options.maxDepth = 0; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - options.maxDepth = options.callDepth; - - /** - * initialized - A boolean which indicates whether or not this component has initialized - */ - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - /** - * instance - Holds the current instance of this object as determined (built) by the runtime object. - */ - if (typeof options.instance === 'undefined') { - options.instance = null; - } - /** - * initializeDepth - The amount of times this component passed through initialize() functions - */ - if (typeof options.initializeDepth === 'undefined') { - options.initializeDepth = 0; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - } - - /** - * initialize() - * - Notifies all systems listening that this component initialized. - */ - initialize() { - - super.initialize(); - - if (this.initializeDepth === this.maxDepth) { - - if (this instanceof R3.Component) { - this.createInstance(); - } - - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } @@ -6227,7 +6227,7 @@ class Project extends R3Object { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } @@ -6608,39 +6608,6 @@ class Utils { result[name].w = false; }; - static ObjectPropertiesAsBoolean(object) { - return Object.keys(object).reduce( - function(result, propertyId) { - - if (typeof object[propertyId] === 'function') { - return result; - } - - result[propertyId] = false; - - // if (object[propertyId] instanceof R3.Vector2) { - // Utils.BuildVectorSource(result, propertyId, 2); - // } - // - // if (object[propertyId] instanceof R3.Vector3) { - // Utils.BuildVectorSource(result, propertyId, 3); - // } - // - // if (object[propertyId] instanceof R3.Vector4) { - // Utils.BuildVectorSource(result, propertyId, 4); - // } - // - // if (object[propertyId] instanceof R3.Quaternion) { - // Utils.BuildQuaternionSource(result, propertyId); - // } - - return result; - - }.bind(this), - {} - ); - }; - static GetRuntime() { let result = null; @@ -6714,14 +6681,6 @@ class Utils { ); }; - static LoadIdsFromArrayToIdObject(array, idToObject) { - - }; - - static LoadIdsFromObjectToIdObject(object, idToObject) { - - }; - /** * Gets random int exclusive of maximum but inclusive of minimum * @param min @@ -6898,26 +6857,6 @@ class Utils { } }; - /** - * Links an object to its parent through idToObject array - * @param propertyString - * @param idToObject - * @param parentObject - * @param id - * @constructor - */ - static Link(propertyString, idToObject, parentObject, id) { - - if (!Utils.UndefinedOrNull(parentObject[propertyString])) { - - if (!idToObject.hasOwnProperty(id)) { - console.warn('Linking failed for object:' + parentObject.name); - } - - parentObject[propertyString] = idToObject[id]; - } - }; - /** * Generates a random ID * @returns {string} @@ -7490,6 +7429,7 @@ System.Render = SystemRender; System.Runtime = SystemRuntime; System.Socket = SystemSocket; System.Storage = SystemStorage; +Component.Code = ComponentCode; Component.DOM = ComponentDOM; Component.DOM.Canvas = ComponentCanvas; Component.Graphics = ComponentGraphics; @@ -7499,7 +7439,6 @@ Component.Graphics.Mesh = ComponentMesh; Component.Graphics.Texture = ComponentTexture; Component.Input = ComponentInput; Component.Input.Touch = ComponentTouch; -Component.Code = ComponentCode; Runtime.Coder = RuntimeCoder; Runtime.Coder.CodeMirror = RuntimeCodeMirror; Runtime.DOM = RuntimeDOM; @@ -7525,13 +7464,13 @@ R3.Object = R3Object; R3.Entity = Entity; R3.Component = Component; R3.Project = Project; +R3.Code = Component.Code; R3.Canvas = Component.DOM.Canvas; R3.Image = Component.Graphics.Image; R3.Material = Component.Graphics.Material; R3.Mesh = Component.Graphics.Mesh; R3.Texture = Component.Graphics.Texture; R3.Touch = Component.Input.Touch; -R3.Code = Component.Code; console.log('r3.js - version ' + R3.version + ' compiled ' + R3.compileDate); R3.System.DOM.Start(); diff --git a/package.json b/package.json index eb01241..03cf5a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "r3", - "version" : "3.0.69", + "version" : "3.0.73", "description": "", "private": true, "dependencies": { diff --git a/src/r3/r3-component-code.js b/src/r3/r3-component-code.js deleted file mode 100644 index f154cf9..0000000 --- a/src/r3/r3-component-code.js +++ /dev/null @@ -1,333 +0,0 @@ -const Event = require('./r3-event'); -const Utils = require('./r3-utils'); -const Component = require('./r3-component.js'); - -/** - - GENERATED_INHERITED_START - - Class R3.Event.Object.Component.Code - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - async(eventId, data, clientCallback, clientErrorCallback) - Simply calls 'Async()' passing it the arguments - - - emit(eventId, data, clientCallback, clientErrorCallback) - Simply calls 'Emit()' passing it the arguments - - - subscribe(eventId, callback) - Simply calls 'Subscribe()' passing it the arguments - - Inherited Static Methods: - - - Async(eventId, data, clientCallback, clientErrorCallback) - Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as - arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the - error as argument. - - - Emit(eventId, data, clientCallback, clientErrorCallback) - Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after - the event result is obtained, passing it the result. If an exception occurs during execution, the - clientErrorCallback is called with the error as argument. - - - Subscribe(eventId, callback) - Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised - - [Inherited from R3Object] - - Inherited Properties: - - - id (Default value Utils.RandomId(15) - Each Object receives an 15 digit random ID which uniquely - identifies it everywhere (client and server side)) - - name (Default value 'Object ' + options.id - Each Object has a name) - - parent (Default value null - All objects could have a parent) - - children (Default value [] - All objects could have some children) - - Inherited Static Properties: - - - - Inherited Methods: - - - - Inherited Static Methods: - - - - [Inherited from Component] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - - Inherited Static Methods: - - - - [Belonging to ComponentCode] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - GENERATED_INHERITED_END - - TEMPLATE_OPTIONS_START - initialized=false - A boolean which indicates whether or not this component has initialized - instance=null - Holds the current instance of this object as determined (built) by the runtime object. - initializeDepth=0 - The amount of times this component passed through initialize() functions - 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_INSTANCE_OPTIONS_MAPPING_START - TEMPLATE_INSTANCE_OPTIONS_MAPPING_END - - CUSTOM_INSTANCE_OPTIONS_MAPPING_START - CUSTOM_INSTANCE_OPTIONS_MAPPING_END - - TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START - instance - initializeDepth - initialized - TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END - - CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START - CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END - - TEMPLATE_METHODS_START - initialize() - Notifies all systems listening that this component initialized. - updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. - updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. - 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 ComponentCode extends Component { - - //GENERATED_CONSTRUCTOR_START - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.maxDepth === 'undefined') { - options.maxDepth = 0; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - options.maxDepth = options.callDepth; - - //GENERATED_TEMPLATE_OPTIONS_INIT_START - /** - * initialized - A boolean which indicates whether or not this component has initialized - */ - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - /** - * instance - Holds the current instance of this object as determined (built) by the runtime object. - */ - if (typeof options.instance === 'undefined') { - options.instance = null; - } - /** - * initializeDepth - The amount of times this component passed through initialize() functions - */ - if (typeof options.initializeDepth === 'undefined') { - options.initializeDepth = 0; - } - //GENERATED_TEMPLATE_OPTIONS_INIT_END - - super(options); - - //GENERATED_OPTIONS_INIT_START - //GENERATED_OPTIONS_INIT_END - - //CUSTOM_OPTIONS_INIT_START - //CUSTOM_OPTIONS_INIT_END - - Object.assign(this, options); - - //CUSTOM_BEFORE_INIT_START - //CUSTOM_BEFORE_INIT_END - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - //CUSTOM_AFTER_INIT_START - //CUSTOM_AFTER_INIT_END - } - //GENERATED_CONSTRUCTOR_END - - //GENERATED_TEMPLATE_METHODS_START - - /** - * initialize() - * - Notifies all systems listening that this component initialized. - */ - initialize() { - - //GENERATED_INITIALIZE_METHOD_START - super.initialize(); - //GENERATED_INITIALIZE_METHOD_END - - //CUSTOM_INITIALIZE_METHOD_START - //CUSTOM_INITIALIZE_METHOD_END - - //GENERATED_INITIALIZE_METHOD_AFTER_START - if (this.initializeDepth === this.maxDepth) { - - if (this instanceof R3.Component) { - this.createInstance(); - } - - if (this instanceof R3.Entity && this.initialized) { - this.start(); - } - - } else { - this.initializeDepth++; - } - //GENERATED_INITIALIZE_METHOD_AFTER_END - - } - - /** - * updateInstance() - * - Updates this object by copying the values of the current object into it's instance object. - * @param property - */ - updateInstance(property) { - - //GENERATED_UPDATE_INSTANCE_METHOD_START - this.emit(Event.UPDATE_INSTANCE_BEFORE, this); - - //GENERATED_UPDATE_INSTANCE_OPTIONS_START - //GENERATED_UPDATE_INSTANCE_OPTIONS_END - - //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START - //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END - - this.emit(Event.UPDATE_INSTANCE_AFTER, this); - //GENERATED_UPDATE_INSTANCE_METHOD_END - - //CUSTOM_UPDATE_INSTANCE_METHOD_START - //CUSTOM_UPDATE_INSTANCE_METHOD_END - - //GENERATED_UPDATE_INSTANCE_METHOD_AFTER_START - //GENERATED_UPDATE_INSTANCE_METHOD_AFTER_END - - } - - /** - * updateFromInstance() - * - Updates this object by copying the values of its instance into the current object. - * @param property - */ - updateFromInstance(property) { - - //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START - this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); - - //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START - //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END - - //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START - //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END - - this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); - - //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END - - //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START - //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END - - //GENERATED_UPDATE_FROM_INSTANCE_METHOD_AFTER_START - //GENERATED_UPDATE_FROM_INSTANCE_METHOD_AFTER_END - - } - //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 - -//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START -//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END - -module.exports = ComponentCode; diff --git a/src/r3/r3-component/index.js b/src/r3/r3-component/index.js index 3375de7..01e8f14 100644 --- a/src/r3/r3-component/index.js +++ b/src/r3/r3-component/index.js @@ -1,5 +1,6 @@ //GENERATED_IMPORTS_START const Component = require('./r3-component.js'); +const ComponentCode = require('./r3-component-code.js'); const ComponentDOM = require('./r3-component-d-o-m.js'); const ComponentCanvas = require('./r3-component-canvas.js'); const ComponentGraphics = require('./r3-component-graphics.js'); @@ -9,10 +10,10 @@ const ComponentMesh = require('./r3-component-mesh.js'); const ComponentTexture = require('./r3-component-texture.js'); const ComponentInput = require('./r3-component-input.js'); const ComponentTouch = require('./r3-component-touch.js'); -const ComponentCode = require('.-code.js'); //GENERATED_IMPORTS_END //GENERATED_INDEX_BODY_START +Component.Code = ComponentCode; Component.DOM = ComponentDOM; Component.DOM.Canvas = ComponentCanvas; Component.Graphics = ComponentGraphics; @@ -22,7 +23,6 @@ Component.Graphics.Mesh = ComponentMesh; Component.Graphics.Texture = ComponentTexture; Component.Input = ComponentInput; Component.Input.Touch = ComponentTouch; -Component.Code = ComponentCode; //GENERATED_INDEX_BODY_END //GENERATED_EXPORTS_START diff --git a/src/r3/r3-component/r3-component-canvas.js b/src/r3/r3-component/r3-component-canvas.js index 3d10136..d0f5533 100644 --- a/src/r3/r3-component/r3-component-canvas.js +++ b/src/r3/r3-component/r3-component-canvas.js @@ -289,7 +289,7 @@ class ComponentCanvas extends ComponentDOM { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } diff --git a/src/r3/r3-component/r3-component-d-o-m.js b/src/r3/r3-component/r3-component-d-o-m.js index 9ac01a5..649f7be 100644 --- a/src/r3/r3-component/r3-component-d-o-m.js +++ b/src/r3/r3-component/r3-component-d-o-m.js @@ -247,7 +247,7 @@ class ComponentDOM extends Component { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } diff --git a/src/r3/r3-component/r3-component-graphics.js b/src/r3/r3-component/r3-component-graphics.js index 0cb04da..ce49219 100644 --- a/src/r3/r3-component/r3-component-graphics.js +++ b/src/r3/r3-component/r3-component-graphics.js @@ -239,7 +239,7 @@ class ComponentGraphics extends Component { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } diff --git a/src/r3/r3-component/r3-component-image.js b/src/r3/r3-component/r3-component-image.js index d4096c7..2234eff 100644 --- a/src/r3/r3-component/r3-component-image.js +++ b/src/r3/r3-component/r3-component-image.js @@ -380,7 +380,7 @@ class ComponentImage extends ComponentGraphics { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } diff --git a/src/r3/r3-component/r3-component-input.js b/src/r3/r3-component/r3-component-input.js index cc64aaa..015c9c1 100644 --- a/src/r3/r3-component/r3-component-input.js +++ b/src/r3/r3-component/r3-component-input.js @@ -239,7 +239,7 @@ class ComponentInput extends Component { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } diff --git a/src/r3/r3-component/r3-component-material.js b/src/r3/r3-component/r3-component-material.js index 4d46cc2..78d89da 100644 --- a/src/r3/r3-component/r3-component-material.js +++ b/src/r3/r3-component/r3-component-material.js @@ -256,7 +256,7 @@ class ComponentMaterial extends ComponentGraphics { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } diff --git a/src/r3/r3-component/r3-component-mesh.js b/src/r3/r3-component/r3-component-mesh.js index c62d4b1..66da9a1 100644 --- a/src/r3/r3-component/r3-component-mesh.js +++ b/src/r3/r3-component/r3-component-mesh.js @@ -256,7 +256,7 @@ class ComponentMesh extends ComponentGraphics { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } diff --git a/src/r3/r3-component/r3-component-texture.js b/src/r3/r3-component/r3-component-texture.js index be3b348..a97f683 100644 --- a/src/r3/r3-component/r3-component-texture.js +++ b/src/r3/r3-component/r3-component-texture.js @@ -256,7 +256,7 @@ class ComponentTexture extends ComponentGraphics { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } diff --git a/src/r3/r3-component/r3-component-touch.js b/src/r3/r3-component/r3-component-touch.js index 2b2c41a..c12b1e5 100644 --- a/src/r3/r3-component/r3-component-touch.js +++ b/src/r3/r3-component/r3-component-touch.js @@ -256,7 +256,7 @@ class ComponentTouch extends ComponentInput { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } diff --git a/src/r3/r3-component/r3-component.js b/src/r3/r3-component/r3-component.js index bfafc3d..e15794d 100644 --- a/src/r3/r3-component/r3-component.js +++ b/src/r3/r3-component/r3-component.js @@ -322,16 +322,16 @@ class Component extends R3Object { //GENERATED_STATIC_OPTIONS_INIT_END //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START -Component.DOM = 0x0; -Component.CANVAS = 0x1; -Component.GRAPHICS = 0x2; -Component.IMAGE = 0x3; -Component.MATERIAL = 0x4; -Component.MESH = 0x5; -Component.TEXTURE = 0x6; -Component.INPUT = 0x7; -Component.TOUCH = 0x8; -Component.CODE = 0x9; +Component.CODE = 0x0; +Component.DOM = 0x1; +Component.CANVAS = 0x2; +Component.GRAPHICS = 0x3; +Component.IMAGE = 0x4; +Component.MATERIAL = 0x5; +Component.MESH = 0x6; +Component.TEXTURE = 0x7; +Component.INPUT = 0x8; +Component.TOUCH = 0x9; Component.MAX_COMPONENT = 0xa; //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/r3/r3-project.js b/src/r3/r3-project.js index f6c84ea..935b43a 100644 --- a/src/r3/r3-project.js +++ b/src/r3/r3-project.js @@ -166,7 +166,7 @@ class Project extends R3Object { this.createInstance(); } - if (this instanceof R3.Entity && this.initialized) { + if (this instanceof R3.Entity && this.initialized && !this.started) { this.start(); } diff --git a/src/r3/r3-r3.js b/src/r3/r3-r3.js index 3bcdd2e..5bfc859 100644 --- a/src/r3/r3-r3.js +++ b/src/r3/r3-r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '3.0.69'; - static compileDate = '2021 Sep 23 - 20:23:57 pm'; + static version = '3.0.73'; + static compileDate = '2021 Sep 24 - 07:04:55 am'; } //GENERATED_IMPORTS_START @@ -23,13 +23,13 @@ R3.Object = R3Object; R3.Entity = Entity; R3.Component = Component; R3.Project = Project; +R3.Code = Component.Code; R3.Canvas = Component.DOM.Canvas; R3.Image = Component.Graphics.Image; R3.Material = Component.Graphics.Material; R3.Mesh = Component.Graphics.Mesh; R3.Texture = Component.Graphics.Texture; R3.Touch = Component.Input.Touch; -R3.Code = Component.Code; //GENERATED_DEFINES_END //CUSTOM_CONVENIENT_DEFINES_START diff --git a/src/r3/r3-utils.js b/src/r3/r3-utils.js index 50b352c..00629ad 100644 --- a/src/r3/r3-utils.js +++ b/src/r3/r3-utils.js @@ -431,39 +431,6 @@ class Utils { result[name].w = false; }; - static ObjectPropertiesAsBoolean(object) { - return Object.keys(object).reduce( - function(result, propertyId) { - - if (typeof object[propertyId] === 'function') { - return result; - } - - result[propertyId] = false; - - // if (object[propertyId] instanceof R3.Vector2) { - // Utils.BuildVectorSource(result, propertyId, 2); - // } - // - // if (object[propertyId] instanceof R3.Vector3) { - // Utils.BuildVectorSource(result, propertyId, 3); - // } - // - // if (object[propertyId] instanceof R3.Vector4) { - // Utils.BuildVectorSource(result, propertyId, 4); - // } - // - // if (object[propertyId] instanceof R3.Quaternion) { - // Utils.BuildQuaternionSource(result, propertyId); - // } - - return result; - - }.bind(this), - {} - ); - }; - static GetRuntime() { let result = null; @@ -538,15 +505,6 @@ class Utils { ); }; - static LoadIdsFromArrayToIdObject(array, idToObject) { - - }; - - static LoadIdsFromObjectToIdObject(object, idToObject) { - - - }; - /** * Gets random int exclusive of maximum but inclusive of minimum * @param min @@ -723,26 +681,6 @@ class Utils { } }; - /** - * Links an object to its parent through idToObject array - * @param propertyString - * @param idToObject - * @param parentObject - * @param id - * @constructor - */ - static Link(propertyString, idToObject, parentObject, id) { - - if (!Utils.UndefinedOrNull(parentObject[propertyString])) { - - if (!idToObject.hasOwnProperty(id)) { - console.warn('Linking failed for object:' + parentObject.name); - } - - parentObject[propertyString] = idToObject[id]; - } - }; - /** * Generates a random ID * @returns {string} diff --git a/version b/version index 6f495ea..9ad03a7 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.0.69 \ No newline at end of file +3.0.73 \ No newline at end of file