playh5 Posted January 18, 2014 Share Posted January 18, 2014 Hi I have this code that works on desktop browser but is crashing the mobile browserscreate:function(){ this.game.input.addPointer(); this.playBtn = this.game.add.sprite(this.game.world.centerX,400,'playBtn'); this.playBtn.anchor.setTo(0.5,0.5); this.playBtn.inputEnabled = true; this.playBtn.events.onInputDown.add(this.gotoGame,this); },gotoGame:function(gotoGame,pointer){ console.log('go to game'); this.game.state.start('game');}please point my mistakes. Thanks in advance. Link to comment Share on other sites More sharing options...
rich Posted January 18, 2014 Share Posted January 18, 2014 You don't need to call input.addPointer. That's only if you need a multi-touch system (i.e. 3+ touches at once). Link to comment Share on other sites More sharing options...
playh5 Posted January 18, 2014 Author Share Posted January 18, 2014 Thanks Rich! I removed input.addPointer() but mobile browsers still crashes. Link to comment Share on other sites More sharing options...
rich Posted January 19, 2014 Share Posted January 19, 2014 There is nothing in that little bit of code that could crash a mobile browser specifically. I wouldn't have a parameter with the same name as the function, but doubt that causes it. Must be elsewhere I reckon. Link to comment Share on other sites More sharing options...
playh5 Posted January 19, 2014 Author Share Posted January 19, 2014 Yeah I removed it but its the same. But oh yes that parameter should be the playBtn still nothing happens Link to comment Share on other sites More sharing options...
playh5 Posted February 5, 2014 Author Share Posted February 5, 2014 Found the problem. I tried to my asus memo pad and it works but on my testing device xperia lt26i doesn't work at all. Link to comment Share on other sites More sharing options...
rich Posted February 5, 2014 Share Posted February 5, 2014 I don't own an xperia, so you're going to have to provide some debug info if you can, in order for me to fix this. Link to comment Share on other sites More sharing options...
Recommended Posts