JToaster Posted May 20, 2014 Share Posted May 20, 2014 I'm trying to make it to where the user can draw lines on the screen, with a bitmapData object. When I try to draw on the screen, I get a 404 error, and I'm not sure why. Any help is appreciated! Here's my code:var game= new Phaser.Game(720,1000,Phaser.CANVAS, 'game_div');var play={ preload: function() { this.game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.game.scale.setShowAll(); game.scale.refresh(); this.game.load.image('nope','assets/wrong.png'); }, create: function() { this.bmd=this.game.add.bitmapData(720,1000); this.ctx=this.bmd.context; this.ctx.setLineWidth(5.0); this.ctx.setFillColor(255,0,0,0); this.game.add.sprite(0,0,this.bmd); this.game.stage.backgroundColor='#ab54c1'; this.game.scale.forceOrientation(false, true, 'nope'); }, update: function() { if(this.game.input.activePointer.isDown) { this.ctx.lineTo(this.game.input.activePointer.x,this.game.input.activePointer.y); } }}game.state.add('play', play);game.state.start('play'); Link to comment Share on other sites More sharing options...
rich Posted May 20, 2014 Share Posted May 20, 2014 A 404 error? As in "page not found" ?? Link to comment Share on other sites More sharing options...
JToaster Posted May 20, 2014 Author Share Posted May 20, 2014 Correct. The error points to Phaser.map? Link to comment Share on other sites More sharing options...
rich Posted May 20, 2014 Share Posted May 20, 2014 The 404 is nothing to do with the above code btw. It's to do with how the page / server has been set-up. The phaser.map file is a sourcemap. You'll find it in the repository in the build folder if you need it. Link to comment Share on other sites More sharing options...
JToaster Posted May 20, 2014 Author Share Posted May 20, 2014 Hm. So what about the bitmapData object causes this error? How exactly can I fix it/make sure it won't happen again? Link to comment Share on other sites More sharing options...
rich Posted May 20, 2014 Share Posted May 20, 2014 Like I said, your code has nothing to do with the 404. http://stackoverflow.com/a/18365316/1737823 Link to comment Share on other sites More sharing options...
Heppell08 Posted May 20, 2014 Share Posted May 20, 2014 Was gonna ask what that map file was for, read richs link and happy with that response. Wondered about the map file myself but wasn't really effecting my coding progress and wasn't worried. Glad I know what the map file is for now though. Link to comment Share on other sites More sharing options...
JToaster Posted May 20, 2014 Author Share Posted May 20, 2014 Ah, ok. As always, thanks rich! Your dedication is incredible and you've indirectly helped me with so many problems. Keep up the good work! Link to comment Share on other sites More sharing options...
Recommended Posts