From b28eb44fcb5fe1a4c5b27c162c7d9d1749ed0d4d Mon Sep 17 00:00:00 2001 From: Adi Mora Date: Mon, 9 Feb 2015 12:26:05 +0000 Subject: [PATCH 1/2] minor bug fixes --- docs.xml | 86 +++++++++++++++++++++++++-------- haxelib.json | 6 +-- package.json | 2 +- pixi/Application.hx | 26 +++++----- samples/_output/hx-pixi-nape.js | 3 ++ 5 files changed, 87 insertions(+), 36 deletions(-) diff --git a/docs.xml b/docs.xml index 5e7062b4..bdc08bf0 100644 --- a/docs.xml +++ b/docs.xml @@ -13457,25 +13457,61 @@ Documentation for this class was provided by <_stage set="null"> - <_canvas> - <_renderer> - <_stats> - <_lastTime> - <_currentTime> - <_elapsedTime> - <_skipFrame> - <_setDefaultValues set="method" line="96"> + <_canvas> + + + + <_renderer> + + + + <_stats> + + + + <_lastTime> + + + + <_currentTime> + + + + <_elapsedTime> + + + + <_skipFrame> + + + + <_setDefaultValues set="method" line="96"> + + + - <_onWindowResize set="method" line="126"> - - - - <_onRequestAnimationFrame set="method" line="135"> - <_calculateElapsedTime set="method" line="147"> - - - - + <_onWindowResize set="method" line="126"> + + + + + + + <_onRequestAnimationFrame set="method" line="135"> + + + + <_calculateElapsedTime set="method" line="147"> + + + + + + + + + + @@ -17588,7 +17624,19 @@ Documentation for this class was provided by "PIXI.GraphicsData" - + + + + + + + + + + + + + diff --git a/haxelib.json b/haxelib.json index f15580e6..16d440e9 100644 --- a/haxelib.json +++ b/haxelib.json @@ -2,10 +2,10 @@ "name": "pixijs", "license": "MIT", "tags": ["js","haxe","pixi","extern","web"], - "description": "Externs of pixi.js v2.2.3 for Haxe - JavaScript 2D webGL renderer with canvas fallback.", + "description": "Externs of pixi.js v2.2.5 for Haxe - JavaScript 2D webGL renderer with canvas fallback.", "contributors": ["adireddy"], - "releasenote": "", - "version": "2.2.5", + "releasenote": "minor bug fixes", + "version": "2.2.6", "url": "https://github.com/adireddy/haxe-pixi", "dependencies": { diff --git a/package.json b/package.json index 5e31c29d..95b1403e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixijs", - "version": "2.2.5", + "version": "2.2.6", "description": "Externs of pixi.js v2.2.0 for Haxe - JavaScript 2D webGL renderer with canvas fallback.", "repository": { "type": "git", diff --git a/pixi/Application.hx b/pixi/Application.hx index 3069daa4..176b5640 100644 --- a/pixi/Application.hx +++ b/pixi/Application.hx @@ -11,10 +11,10 @@ package pixi; import js.html.Event; import js.html.CanvasElement; import js.Browser; -import pixi.renderers.webgl.WebGLRenderer; import pixi.utils.Detector; import pixi.display.Stage; import pixi.utils.Stats; +import pixi.renderers.IRenderer; class Application { @@ -79,21 +79,21 @@ class Application { */ var _stage(default, null):Stage; - var _canvas:CanvasElement; - var _renderer:WebGLRenderer; - var _stats:Stats; + @:noCompletion var _canvas:CanvasElement; + @:noCompletion var _renderer:IRenderer; + @:noCompletion var _stats:Stats; - var _lastTime:Date; - var _currentTime:Date; - var _elapsedTime:Float; - var _skipFrame:Bool; + @:noCompletion var _lastTime:Date; + @:noCompletion var _currentTime:Date; + @:noCompletion var _elapsedTime:Float; + @:noCompletion var _skipFrame:Bool; public function new() { _lastTime = Date.now(); _setDefaultValues(); } - function _setDefaultValues() { + @:noCompletion function _setDefaultValues() { pixelRatio = 1; skipFrame = false; stats = false; @@ -123,7 +123,7 @@ class Application { _lastTime = Date.now(); } - function _onWindowResize(event:Event) { + @:noCompletion function _onWindowResize(event:Event) { width = Browser.window.innerWidth; height = Browser.window.innerHeight; _renderer.resize(width, height); @@ -132,7 +132,7 @@ class Application { if (onResize != null) onResize(); } - function _onRequestAnimationFrame() { + @:noCompletion function _onRequestAnimationFrame() { if (skipFrame && _skipFrame) _skipFrame = false; else { _skipFrame = true; @@ -144,13 +144,13 @@ class Application { if (_stats != null) _stats.update(); } - function _calculateElapsedTime() { + @:noCompletion function _calculateElapsedTime() { _currentTime = Date.now(); _elapsedTime = _currentTime.getTime() - _lastTime.getTime(); _lastTime = _currentTime; } - function set_stats(val:Bool):Bool { + @:noCompletion function set_stats(val:Bool):Bool { if (val) { var _container = Browser.document.createElement("div"); Browser.document.body.appendChild(_container); diff --git a/samples/_output/hx-pixi-nape.js b/samples/_output/hx-pixi-nape.js index 6676512a..d1279f7a 100644 --- a/samples/_output/hx-pixi-nape.js +++ b/samples/_output/hx-pixi-nape.js @@ -3457,6 +3457,9 @@ pixi.display.DisplayObjectContainer.prototype = $extend(PIXI.DisplayObjectContai pixi.renderers = {}; pixi.renderers.IRenderer = function() { }; pixi.renderers.IRenderer.__name__ = true; +pixi.renderers.IRenderer.prototype = { + __class__: pixi.renderers.IRenderer +}; var samples = {}; samples.nape = {}; samples.nape.Main = function() { From 2795a6023fd6b3de42314b9876638f76891c8452 Mon Sep 17 00:00:00 2001 From: Adi Mora Date: Mon, 9 Feb 2015 13:01:34 +0000 Subject: [PATCH 2/2] 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(); }