BliantFive Posted February 16, 2016 Share Posted February 16, 2016 Hi guys, for a proof of concept i use a very lightweight drag and drop scrolling script. Its just this in the update function of a controlling object: if (game.input.activePointer.isDown) { if(this.dragstart == false){ this.dragstart = {x: game.input.x, y: game.input.y}; this.camerastart = {x: game.camera.x, y: game.camera.y}; } else { x = this.dragstart.x - game.input.x; y = this.dragstart.y - game.input.y; game.camera.x = this.camerastart.x + x; game.camera.y = this.camerastart.y + y; this.game.debuginfo = x; } } else { this.dragstart = false; this.camerastart = false; } Very basic stuff. It works without problems except that as soon as i use it my eyes start to hurt badly. While scrolling the sprites used start to blurr. This is no problem in itself but it causes my eyes to loose focus and...yeah...hurt. My guess is the following: While moving the camera position is jumping back and forth slightly, causing the effect. You can strengthen the effect by using game.input.worldX instead of game.input.x. I have no idea how to solve it but I can't present my concept to anyone as long as it causes heads to explode. Has anyone an idea how to solve the issue and make the scroll script more smooth? Thanks in advance, Mike Link to comment Share on other sites More sharing options...
fillmoreb Posted February 16, 2016 Share Posted February 16, 2016 Perhaps the camera is being set to non-round values. I know that can blur things sometimes. Try doing this: game.camera.x = Math.round(this.camerastart.x + x); game.camera.y = Math.round(this.camerastart.y + y); And see if it helps. Link to comment Share on other sites More sharing options...
jdnichollsc Posted February 17, 2016 Share Posted February 17, 2016 Ey man, try this http://jdnichollsc.github.io/Phaser-Kinetic-Scrolling-Plugin/ leaf37 1 Link to comment Share on other sites More sharing options...
zeke_chan Posted February 17, 2016 Share Posted February 17, 2016 Could you post a link to see how it looks like? Link to comment Share on other sites More sharing options...
leaf37 Posted February 18, 2016 Share Posted February 18, 2016 21 hours ago, Nicholls said: Ey man, try this http://jdnichollsc.github.io/Phaser-Kinetic-Scrolling-Plugin/ Thank you for your plugin :-D jdnichollsc 1 Link to comment Share on other sites More sharing options...
Recommended Posts