Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Commit

Permalink
minor bug fix in Application class
Browse files Browse the repository at this point in the history
  • Loading branch information
adireddy committed Feb 9, 2015
1 parent b28eb44 commit 2795a60
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 21 deletions.
10 changes: 5 additions & 5 deletions docs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13489,23 +13489,23 @@ Documentation for this class was provided by <a href="https://developer.mozilla.
<f a=""><x path="Void"/></f>
<meta><m n=":noCompletion"/></meta>
</_setDefaultValues>
<start public="1" set="method" line="106"><f a=""><x path="Void"/></f></start>
<_onWindowResize set="method" line="126">
<start public="1" set="method" line="107"><f a=""><x path="Void"/></f></start>
<_onWindowResize set="method" line="127">
<f a="event">
<c path="js.html.Event"/>
<x path="Void"/>
</f>
<meta><m n=":noCompletion"/></meta>
</_onWindowResize>
<_onRequestAnimationFrame set="method" line="135">
<_onRequestAnimationFrame set="method" line="136">
<f a=""><x path="Void"/></f>
<meta><m n=":noCompletion"/></meta>
</_onRequestAnimationFrame>
<_calculateElapsedTime set="method" line="147">
<_calculateElapsedTime set="method" line="148">
<f a=""><x path="Void"/></f>
<meta><m n=":noCompletion"/></meta>
</_calculateElapsedTime>
<set_stats set="method" line="153">
<set_stats set="method" line="154">
<f a="val">
<x path="Bool"/>
<x path="Bool"/>
Expand Down
3 changes: 2 additions & 1 deletion pixi/Application.hx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class Application {
backgroundColor = 0xFFFFFF;
width = Browser.window.innerWidth;
height = Browser.window.innerHeight;
resize = true;
_skipFrame = false;
}

Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-basics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-bitmaptext.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-blur.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-bunnymark.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-colourmatrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-movieclip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-nape.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-particles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-pixidude.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-rendertexture.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-snake.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-spine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-spritesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion samples/_output/hx-pixi-tilingsprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down

0 comments on commit 2795a60

Please sign in to comment.