earok Posted September 21, 2013 Share Posted September 21, 2013 Hi there, Maybe I'm doing this wrong but I ran into an issue creating primitives, although I came up with a hacky work around (below). This code below will crash with "Uncaught TypeError: Cannot call method 'update' of undefined". I used the phaser.js file from the 1.0.5 build. var line; var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload(){ } function create(){ //Uncomment this for rough work around fix //game.add.graphics = function (x, y) { // var graphics = new Phaser.Graphics(this.game, x, y); // Phaser.Sprite.call(graphics,this.game,x,y); // this.world.group.add(graphics); // return graphics; //}; line = game.add.graphics(0,0); } function update(){ line.clear(); line.lineStyle(10,3685702,1); line.moveTo(100,100); line.lineTo(200,200); }Cheers,Erik Link to comment Share on other sites More sharing options...
rich Posted September 21, 2013 Share Posted September 21, 2013 Sorry yes, this is a bug. Will fix for 1.0.6 release. Link to comment Share on other sites More sharing options...
earok Posted September 22, 2013 Author Share Posted September 22, 2013 No problem Rich. Thanks for making an awesome framework, really impressed with it so far. Link to comment Share on other sites More sharing options...
pawelw Posted September 23, 2013 Share Posted September 23, 2013 Maybe I'm doing this wrong but I ran into an issue creating primitives, although I came up with a hacky work around (below). Wanted to report the same issue, but found this post Works like a charm, thanks! Link to comment Share on other sites More sharing options...
rich Posted September 23, 2013 Share Posted September 23, 2013 This is now fully fixed in the dev branch, so will go live this week. Link to comment Share on other sites More sharing options...
Recommended Posts