proyecto26 / Phaser-Kinetic-Scrolling-Plugin

Kinetic Scrolling plugin for Canvas using Phaser Framework
https://proyecto26.github.io/Phaser-Kinetic-Scrolling-Plugin/
MIT License
131 stars 26 forks source link

Auto scroll activated #25

Closed Thaval closed 5 years ago

Thaval commented 5 years ago

Hi,

I faced a bug I guess. When I enter a state and activate the kinematic scrolling plugin for the first time, everything is fine. When I leave the state and reenter it, the scrolling is activated which means the camera is scrolling although I haven't clicked yet. Of course I call this.game.kineticScrolling.stop(); when I shutdown the state.

Thaval commented 5 years ago

I fixed it by myself by adding this.pressedDown = false; to the stop function.

jdnichollsc commented 5 years ago

Can you attach a demo please?

Thaval commented 5 years ago

I will when I find time. If not, remind me of that. But I dont need to, I come over that when I just looked through the source code. Behaviour: Click on a Phaser Button to enter a new state (let's call it simply S) and start the kinetic plugin. Then, when leaving the state S, again with a Phaser Button (it's always a click event), stop the kinetic plugin (care, pressedDown should still be true). Go back to state S by clicking the Phaser Button and as pressedDown is still true, the kinetic plugin is already active and consumes the click.

I'm trying to reproduce the problem whenever I find time. Currently I'm working on a long time thesis.

jdnichollsc commented 5 years ago

Fixed, thanks for the help!