trying to resize!

beta.r3js.org
Theunis J. Botha 2017-05-09 15:44:29 +02:00
parent d717c22c03
commit a32037a826
3 changed files with 35 additions and 1 deletions

View File

@ -448,10 +448,26 @@ GameLib.D3.Editor.prototype.deSelectObject = function(object) {
}
);
this.selectedObjects = results.rest;
if (this.onDeSelectObject) {
this.onDeSelectObject(results);
}
};
GameLib.D3.Editor.prototype.setSize = function(width, height) {
this.viewports.map(
function(viewport){
viewport.width = width;
viewport.height = height;
viewport.updateInstance();
}
);
this.renderers.map(
function(renderer) {
renderer.setSize(width, height);
}
);
};

View File

@ -417,3 +417,11 @@ GameLib.D3.Game.LoadGameFromApi = function(
xhr.send();
};
GameLib.D3.Game.prototype.setSize = function(width, height) {
this.renderers.map(
function(renderer) {
renderer.setSize(width, height);
}
);
};

View File

@ -64,6 +64,9 @@ GameLib.D3.Renderer.prototype.createInstance = function(update) {
this.height
);
instance.domElement.width = this.width;
instance.domElement.height = this.height;
instance.autoClear = this.autoClear;
instance.preserveDrawingBuffer = this.preserveDrawingBuffer;
@ -112,3 +115,10 @@ GameLib.D3.Renderer.prototype.render = function() {
this.instance.render(this.scene.instance, this.camera.instance);
};
GameLib.D3.Renderer.prototype.setSize = function(width, height) {
this.width = width;
this.height = height;
this.updateInstance();
};