/** * Runtime mouse for updating instance objects * @param graphics GameLib.D3.Graphics * @param apiMouse GameLib.API.Mouse * @constructor */ GameLib.Mouse = function (graphics, apiMouse) { this.graphics = graphics; this.graphics.isNotThreeThrow(); if (GameLib.Utils.UndefinedOrNull(apiMouse)){ apiMouse = {}; } if (apiMouse instanceof GameLib.Mouse) { return apiMouse; } GameLib.API.Mouse.call( this, apiMouse.id, apiMouse.name, apiMouse.x, apiMouse.y, apiMouse.parentEntity ); GameLib.Component.call( this, GameLib.Component.COMPONENT_MOUSE ); }; GameLib.Mouse.prototype = Object.create(GameLib.API.Mouse.prototype); GameLib.Mouse.prototype.constructor = GameLib.Mouse; /** * Creates an instance mouse * @param update * @returns {*} */ GameLib.Mouse.prototype.createInstance = function(update) { return true; }; /** * Updates the instance vector, calls updateInstance on the parent object */ GameLib.Mouse.prototype.updateInstance = function() { }; /** * Converts runtime vector to API Vector * @returns {GameLib.API.Mouse} */ GameLib.Mouse.prototype.toApiObject = function() { return new GameLib.API.Mouse( this.id, this.name, this.x, this.y, this.parentEntity ); };