From 2795a6023fd6b3de42314b9876638f76891c8452 Mon Sep 17 00:00:00 2001 From: Adi Mora Date: Mon, 9 Feb 2015 13:01:34 +0000 Subject: [PATCH] minor bug fix in Application class --- docs.xml | 10 +++++----- pixi/Application.hx | 3 ++- samples/_output/hx-pixi-basics.js | 3 ++- samples/_output/hx-pixi-bitmaptext.js | 3 ++- samples/_output/hx-pixi-blur.js | 3 ++- samples/_output/hx-pixi-bunnymark.js | 3 ++- samples/_output/hx-pixi-colourmatrix.js | 3 ++- samples/_output/hx-pixi-graphics.js | 3 ++- samples/_output/hx-pixi-movieclip.js | 3 ++- samples/_output/hx-pixi-nape.js | 3 ++- samples/_output/hx-pixi-particles.js | 3 ++- samples/_output/hx-pixi-pixidude.js | 3 ++- samples/_output/hx-pixi-rendertexture.js | 3 ++- samples/_output/hx-pixi-snake.js | 3 ++- samples/_output/hx-pixi-spine.js | 3 ++- samples/_output/hx-pixi-spritesheet.js | 3 ++- samples/_output/hx-pixi-tilingsprite.js | 3 ++- 17 files changed, 37 insertions(+), 21 deletions(-) diff --git a/docs.xml b/docs.xml index bdc08bf0..f414eaa9 100644 --- a/docs.xml +++ b/docs.xml @@ -13489,23 +13489,23 @@ Documentation for this class was provided by - - <_onWindowResize set="method" line="126"> + + <_onWindowResize set="method" line="127"> - <_onRequestAnimationFrame set="method" line="135"> + <_onRequestAnimationFrame set="method" line="136"> - <_calculateElapsedTime set="method" line="147"> + <_calculateElapsedTime set="method" line="148"> - + diff --git a/pixi/Application.hx b/pixi/Application.hx index 176b5640..94ae72b4 100644 --- a/pixi/Application.hx +++ b/pixi/Application.hx @@ -100,6 +100,7 @@ class Application { backgroundColor = 0xFFFFFF; width = Browser.window.innerWidth; height = Browser.window.innerHeight; + resize = true; _skipFrame = false; } @@ -118,7 +119,7 @@ class Application { _renderer = Detector.autoDetectRenderer(width, height, renderingOptions); Browser.document.body.appendChild(_renderer.view); - Browser.window.onresize = _onWindowResize; + if (resize) Browser.window.onresize = _onWindowResize; Browser.window.requestAnimationFrame(cast _onRequestAnimationFrame); _lastTime = Date.now(); } diff --git a/samples/_output/hx-pixi-basics.js b/samples/_output/hx-pixi-basics.js index 239c4c29..50bb4619 100644 --- a/samples/_output/hx-pixi-basics.js +++ b/samples/_output/hx-pixi-basics.js @@ -18,6 +18,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -33,7 +34,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-bitmaptext.js b/samples/_output/hx-pixi-bitmaptext.js index 4d48d623..65cd82c8 100644 --- a/samples/_output/hx-pixi-bitmaptext.js +++ b/samples/_output/hx-pixi-bitmaptext.js @@ -18,6 +18,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -33,7 +34,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-blur.js b/samples/_output/hx-pixi-blur.js index 6c362232..34a67090 100644 --- a/samples/_output/hx-pixi-blur.js +++ b/samples/_output/hx-pixi-blur.js @@ -18,6 +18,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -33,7 +34,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-bunnymark.js b/samples/_output/hx-pixi-bunnymark.js index ce0b0d23..85818627 100644 --- a/samples/_output/hx-pixi-bunnymark.js +++ b/samples/_output/hx-pixi-bunnymark.js @@ -22,6 +22,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -37,7 +38,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-colourmatrix.js b/samples/_output/hx-pixi-colourmatrix.js index 6bb7ce1c..303e747d 100644 --- a/samples/_output/hx-pixi-colourmatrix.js +++ b/samples/_output/hx-pixi-colourmatrix.js @@ -18,6 +18,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -33,7 +34,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-graphics.js b/samples/_output/hx-pixi-graphics.js index 23dfab89..813f35ba 100644 --- a/samples/_output/hx-pixi-graphics.js +++ b/samples/_output/hx-pixi-graphics.js @@ -22,6 +22,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -37,7 +38,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-movieclip.js b/samples/_output/hx-pixi-movieclip.js index 079e6a70..89bf414b 100644 --- a/samples/_output/hx-pixi-movieclip.js +++ b/samples/_output/hx-pixi-movieclip.js @@ -22,6 +22,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -37,7 +38,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-nape.js b/samples/_output/hx-pixi-nape.js index d1279f7a..e77c678d 100644 --- a/samples/_output/hx-pixi-nape.js +++ b/samples/_output/hx-pixi-nape.js @@ -3379,6 +3379,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -3394,7 +3395,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-particles.js b/samples/_output/hx-pixi-particles.js index 011893f5..38430ac4 100644 --- a/samples/_output/hx-pixi-particles.js +++ b/samples/_output/hx-pixi-particles.js @@ -27,6 +27,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -42,7 +43,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-pixidude.js b/samples/_output/hx-pixi-pixidude.js index 702a1209..6b2ad93a 100644 --- a/samples/_output/hx-pixi-pixidude.js +++ b/samples/_output/hx-pixi-pixidude.js @@ -18,6 +18,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -33,7 +34,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-rendertexture.js b/samples/_output/hx-pixi-rendertexture.js index bffd726a..e5a281a5 100644 --- a/samples/_output/hx-pixi-rendertexture.js +++ b/samples/_output/hx-pixi-rendertexture.js @@ -18,6 +18,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -33,7 +34,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-snake.js b/samples/_output/hx-pixi-snake.js index 87165160..211bba1e 100644 --- a/samples/_output/hx-pixi-snake.js +++ b/samples/_output/hx-pixi-snake.js @@ -18,6 +18,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -33,7 +34,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-spine.js b/samples/_output/hx-pixi-spine.js index 2d527251..630d688e 100644 --- a/samples/_output/hx-pixi-spine.js +++ b/samples/_output/hx-pixi-spine.js @@ -18,6 +18,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -33,7 +34,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-spritesheet.js b/samples/_output/hx-pixi-spritesheet.js index b467e76a..b124d67e 100644 --- a/samples/_output/hx-pixi-spritesheet.js +++ b/samples/_output/hx-pixi-spritesheet.js @@ -18,6 +18,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -33,7 +34,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); } diff --git a/samples/_output/hx-pixi-tilingsprite.js b/samples/_output/hx-pixi-tilingsprite.js index 7f8971bb..6f8d55b0 100644 --- a/samples/_output/hx-pixi-tilingsprite.js +++ b/samples/_output/hx-pixi-tilingsprite.js @@ -18,6 +18,7 @@ pixi.Application.prototype = { this.backgroundColor = 16777215; this.width = window.innerWidth; this.height = window.innerHeight; + this.resize = true; this._skipFrame = false; } ,start: function() { @@ -33,7 +34,7 @@ pixi.Application.prototype = { renderingOptions.resolution = this.pixelRatio; this._renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); window.document.body.appendChild(this._renderer.view); - window.onresize = $bind(this,this._onWindowResize); + if(this.resize) window.onresize = $bind(this,this._onWindowResize); window.requestAnimationFrame($bind(this,this._onRequestAnimationFrame)); this._lastTime = new Date(); }