diff --git a/src/game-lib-a-0.js b/src/game-lib-a-0.js index eb11dca..f467345 100644 --- a/src/game-lib-a-0.js +++ b/src/game-lib-a-0.js @@ -35,25 +35,25 @@ if (typeof GameLib.D3.Runtime === 'undefined') { GameLib.D3.Runtime = function(){}; } -if (typeof Q === 'undefined') { - - if (typeof require === 'undefined') { - console.warn('You need the Q promise library for the GameLib.D3'); - throw new Error('You need the Q promise library for the GameLib.D3'); - } - - var Q = require('q'); -} - -if (typeof _ === 'undefined') { - - if (typeof require === 'undefined') { - console.warn('You need the lodash library for the GameLib.D3'); - throw new Error('You need the lodash library for the GameLib.D3'); - } - - var _ = require('lodash'); -} +// if (typeof Q === 'undefined') { +// +// if (typeof require === 'undefined') { +// console.warn('You need the Q promise library for the GameLib.D3'); +// throw new Error('You need the Q promise library for the GameLib.D3'); +// } +// +// var Q = require('q'); +// } +// +// if (typeof _ === 'undefined') { +// +// if (typeof require === 'undefined') { +// console.warn('You need the lodash library for the GameLib.D3'); +// throw new Error('You need the lodash library for the GameLib.D3'); +// } +// +// var _ = require('lodash'); +// } // This gets injected by gulp console.log("Loading GameLib compiled at: " + __DATE__); diff --git a/src/game-lib-custom-code.js b/src/game-lib-custom-code.js index 3a1dd54..d719922 100644 --- a/src/game-lib-custom-code.js +++ b/src/game-lib-custom-code.js @@ -139,8 +139,6 @@ GameLib.CustomCode.prototype.launchEditor = function(){ ); } - - this.editor.on('change', function(){ this.code = this.editor.getValue(); diff --git a/src/game-lib-d3-api-camera-orthographic.js b/src/game-lib-d3-api-camera-orthographic.js index 7bed7c8..58209a1 100644 --- a/src/game-lib-d3-api-camera-orthographic.js +++ b/src/game-lib-d3-api-camera-orthographic.js @@ -18,6 +18,8 @@ * @constructor * @param apiCamera * @param aspectRatioMode + * @param minWidth + * @param minHeight * @param width * @param height * @param near diff --git a/src/game-lib-d3-camera-orthographic.js b/src/game-lib-d3-camera-orthographic.js index c9a88de..41aa50c 100644 --- a/src/game-lib-d3-camera-orthographic.js +++ b/src/game-lib-d3-camera-orthographic.js @@ -207,20 +207,40 @@ GameLib.D3.Camera.Orthographic.prototype.updateFromInstance = function() { GameLib.D3.Camera.Orthographic.prototype.updateFromAspectRatio = function() { - if (this.aspect < 1) { + var requiredAspect = this.minWidth / this.minHeight; + + if (this.aspect < requiredAspect) { /** * Make height dependend on width */ this.width = this.minWidth; this.height = this.minWidth / this.aspect; - if (this.height < this.minHeight) { - /** - * We have a problem - our new height is less than our minimum height - */ - this.height = this.minHeight; - this.width = this.aspect * this.height; - } + // if (this.height < this.minHeight) { + // /** + // * We have a problem - our new height is less than our minimum height + // */ + // + // + // ; + // + // if (requiredAspect < this.aspect) { + // this.width = requiredAspect * this.height; + // } else { + // this.height = this.minHeight; + // this.width = this.aspect * this.height; + // } + // + // + // } else { + // + // /** + // * Try to fit our game into the window + // * @type {number} + // */ + // // var requiredAspect = this.minWidth / this.minHeight; + // // this.width = requiredAspect * this.height; + // } } else { /** @@ -228,14 +248,14 @@ GameLib.D3.Camera.Orthographic.prototype.updateFromAspectRatio = function() { */ this.height = this.minHeight; this.width = this.aspect * this.minHeight; - - if (this.width < this.minWidth) { - /** - * We have a problem - our new width is less than our minimum width - */ - this.width = this.minWidth; - this.height = this.width / this.aspect; - } + // + // if (this.width < this.minWidth) { + // /** + // * We have a problem - our new width is less than our minimum width + // */ + // this.width = this.minWidth; + // this.height = this.width / this.aspect; + // } } this.left = this.width / -2; diff --git a/src/game-lib-system-gui.js b/src/game-lib-system-gui.js index 20832bc..44e568a 100644 --- a/src/game-lib-system-gui.js +++ b/src/game-lib-system-gui.js @@ -1609,7 +1609,13 @@ GameLib.System.GUI.prototype.buildControl = function(folder, componentTemplate, property === 'depth' || property === 'radius' ) { - controllers.push(folder.add(object, property, 0, 1000, 0.1)); + + if (object instanceof GameLib.D3.Pass.Bloom) { + controllers.push(folder.add(object, property, -10, 10, 0.001)); + } else { + controllers.push(folder.add(object, property, 0, 1000, 0.1)); + } + } else if ( property === 'near' || property === 'distanceGrain' || @@ -1617,7 +1623,8 @@ GameLib.System.GUI.prototype.buildControl = function(folder, componentTemplate, ) { controllers.push(folder.add(object, property, -10, 100, 0.001)); } else if ( - property === 'bumpScale' + property === 'bumpScale' || + property === 'speed' ) { controllers.push(folder.add(object, property, 0, 20, 0.001)); } else if ( @@ -1652,7 +1659,7 @@ GameLib.System.GUI.prototype.buildControl = function(folder, componentTemplate, property === 'strength' || property === 'power' ) { - controllers.push(folder.add(object, property, 0, 50, 0.001)); + controllers.push(folder.add(object, property, 0, 25, 0.01)); } else if ( property === 'thetaLength' || property === 'angle'