MercuryAX Posted September 20, 2015 Share Posted September 20, 2015 Hi all, I just updated my pixi version to 3.0.7 and am now experiencing an issue with dragging sprites using the touch screen on mobile devices. My original mouse/touch dragging code was based on this example in Pixi 2.x: http://www.goodboydigital.com/pixijs/examples/8/ Originally, you would use this.sy = this.data.getLocalPosition(this).y * this.scale.y;in order to get the global y coordinate of a sprite, for example. I changed this to this.sy = renderer.plugins.interaction.mouse.global.y * this.scale.y;for compatibility with Pixi 3.x. My problem is, this works fine for dragging sprites with a mouse, but seems to be extremely sensitive on a touch screen (moving my sprite way more than it should be). Here is what I'm working on now: http://mercuryax.org/stacks/ Has anybody had a similar issue when upgrading, or in other scenarios, and has been able to fix it? Thank You. Quote Link to comment Share on other sites More sharing options...
xerver Posted September 27, 2015 Share Posted September 27, 2015 Can you try with the latest dev (you will need to compile it yourself)? I feel like I merged a fix for this recently... Quote Link to comment Share on other sites More sharing options...
MercuryAX Posted September 28, 2015 Author Share Posted September 28, 2015 Ah, so there was an actual bug? I cloned the pixi.js repo again and ran gulp, and didn't see any differences though. Have any pointers as to doing it properly? Quote Link to comment Share on other sites More sharing options...
xerver Posted September 28, 2015 Share Posted September 28, 2015 Others have reported that the latest dev build does fix the issue. Are you sure your application is using the newly build pixi.js file, and that it built correctly? Quote Link to comment Share on other sites More sharing options...
MercuryAX Posted September 28, 2015 Author Share Posted September 28, 2015 Please excuse my ignorance, Xerver. I've been looking around, and I'm not sure what you mean by the dev build. Do you mean I have to build what's in the current master branch on github? How is the building done? Thanks for bearing with me here. Quote Link to comment Share on other sites More sharing options...
xerver Posted September 29, 2015 Share Posted September 29, 2015 clone the repo, checkout the `dev` branch, install depdencies (npm install), build pixi (gulp). If you need help building you can look in the readme: https://github.com/pixijs/pixi.js#how-to-build After you rebuilt the `dev` branch use the bin/pixi.js file in your app. Quote Link to comment Share on other sites More sharing options...
MercuryAX Posted September 30, 2015 Author Share Posted September 30, 2015 Thank you, this worked great! My issue with mobile touch dragging is fixed. One last thing I'd like to ask if you don't mind. When pushing my game project files to github (even after compiling pixi with dev branch) it seems that the issue persists with the downloaded project. Do you know why this would happen? Quote Link to comment Share on other sites More sharing options...
xerver Posted September 30, 2015 Share Posted September 30, 2015 Likely just your browser caching an old pixi, make sure to do a cache-free refresh. Quote Link to comment Share on other sites More sharing options...
MercuryAX Posted October 2, 2015 Author Share Posted October 2, 2015 Sadly, after a clean build of the dev branch, I'm now back to the original problem. I have not been able to reproduce the success I had earlier, and I can confirm that it's not a caching issue at least on the client side. Any more recommendations? I could always wait until the next release, that might fix it any build-related problems. Quote Link to comment Share on other sites More sharing options...
coolblue Posted October 2, 2015 Share Posted October 2, 2015 How are you serving the rebuilt version? maybe post a link? Quote Link to comment Share on other sites More sharing options...
MercuryAX Posted October 3, 2015 Author Share Posted October 3, 2015 It's on my original post. Here's another copy: http://mercuryax.org/stacks/ This is a prototype of a block-based game where you drag colored blocks vertically in columns to match like-colored blocks (currently only horizontally). Similar to Meteos. Currently, dragging the blocks up and down only works on the desktop and not on mobile, where they will only move up (and move more than they should). EDIT: Nevermind, I fixed everything by following the new examples. I'm an idiot. 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.