CinkoNaap Posted February 18, 2014 Share Posted February 18, 2014 Hey,does anybody tried to get touch events working in CocoonJS using Pixi 1.5?Regards,Marcin Quote Link to comment Share on other sites More sharing options...
enpu Posted February 18, 2014 Share Posted February 18, 2014 Yes, do you have problems with them? Quote Link to comment Share on other sites More sharing options...
CinkoNaap Posted February 18, 2014 Author Share Posted February 18, 2014 Yea, it seems like they are not dispatched from objects I am listening to ( though PIXI function are getting called ).Sample code: // gameObject is DisplayObjectContainer in this casethis.gameObject.setInteractive(true);this.gameObject.touchdown = this.onStartDrag.bind(this); Quote Link to comment Share on other sites More sharing options...
enpu Posted February 18, 2014 Share Posted February 18, 2014 I think you need to set hitArea for DisplayObjectContainer manually, like this:this.gameObject.hitArea = new PIXI.Rectangle(0, 0, 500, 500);Try if that helps. Quote Link to comment Share on other sites More sharing options...
CinkoNaap Posted February 18, 2014 Author Share Posted February 18, 2014 I tried this:this.gameObject.hitArea = new PIXI.Rectangle(0,0,1000,1000);but still it gives me nothing. It's strange, because mousedown event works fine without setting hitArea ( i know that PIXIs DOC maybe is not calculating it's hit area itself ), but touchdown do not. Quote Link to comment Share on other sites More sharing options...
enpu Posted February 18, 2014 Share Posted February 18, 2014 Ah, try replacing touchdown with touchstart Quote Link to comment Share on other sites More sharing options...
CinkoNaap Posted February 18, 2014 Author Share Posted February 18, 2014 Awesome stuff Thanks! Quote Link to comment Share on other sites More sharing options...
enpu Posted February 18, 2014 Share Posted February 18, 2014 No problem! 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.