sandbird Posted February 4, 2014 Share Posted February 4, 2014 PIXI.autoDetectRenderer is working fine.In the past I have the option to use directly both PIXI.CanvasRenderer and PIXI.WebGLRenderer to force pixi to choose either canvas or webGl.In the latest version it's not possible anymore and:PIXI.CanvasRenderer - always returning null object (on both borwsers with no web-gl and with web-gl support).PIXI.WebGLRenderer - always returning object that doesn't work.PIXI.autoDetectRenderer is working fine. Source code: // Create an new instance of a pixi stage: this.stage = new PIXI.Stage ( 0x000000, true ); // Create a renderer instance: var engineType = 0; // either 0,1 or 2 var widthMax = $(window).width (); var heightMax = $(window).height (); switch ( engineType ) { case 1: case 'canvas': this.renderer = PIXI.CanvasRenderer ( widthMax, heightMax ); break; case 2: case 'webgl': this.renderer = PIXI.WebGLRenderer ( widthMax, heightMax ); break; default: this.renderer = PIXI.autoDetectRenderer ( widthMax, heightMax ); break; } // End of switch. Quote Link to comment Share on other sites More sharing options...
1-800-STAR-WARS Posted February 4, 2014 Share Posted February 4, 2014 autoDetectRenderer is a function, but the others are constructors - you need to add the new keywordthis.renderer = new PIXI.WebGLRenderer ( widthMax, heightMax ); sandbird 1 Quote Link to comment Share on other sites More sharing options...
xerver Posted February 4, 2014 Share Posted February 4, 2014 Lewis has the right of it, you need to use the "new" keeyword when creating an instance of a constructor. Quote Link to comment Share on other sites More sharing options...
sandbird Posted February 8, 2014 Author Share Posted February 8, 2014 OK, thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.