Bobby Posted April 8, 2015 Share Posted April 8, 2015 This is my setup:var win_width = window.innerWidth;var win_height = window.innerHeight;var stage = new PIXI.Stage(0xFFFFFF);var renderer = new PIXI.WebGLRenderer( win_width, win_height, { transparent: true});document.body.insertBefore( renderer.view, document.body.firstChild );var game = requestAnimationFrame( updateGame );var rect = new PIXI.Graphics();rect.beginFill(0x336699);rect.drawRect(0, 0, 400, 400);stage.addChild( rect );function updateGame() { // My simple game logic renderer.render( stage ); game = requestAnimationFrame( updateGame );}And when I open in a browser I got this error messageUncaught TypeError: Cannot read property 'length' of nullTried to change it to autoDetectRenderer and still producing same error but, If I change the renderer to CanvasRenderer, everything work normally. What do I miss? Additional info:Using PIXI v2.2.8Tested in Google Chrome 41, OS X Yosemite Quote Link to comment Share on other sites More sharing options...
Sebi Posted April 9, 2015 Share Posted April 9, 2015 Not sure what's causing the issue but maybe it is because you didn't use rect.endFill(); Quote Link to comment Share on other sites More sharing options...
Bobby Posted April 28, 2015 Author Share Posted April 28, 2015 I end up using PIXI v3 and no more error I mentioned above. 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.