Jump to content

Scrolling script killing my eyes...


BliantFive
 Share

Recommended Posts

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...