Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by noar

I'm developing a game that using impactjs.

Everything is good except a problem, when I touch the screen (the finger do not leave the screen).

Then the screen will be blocked (do not render).

Why? and how to solve it? Thanks.

1 decade ago by dominic

I guess you're talking about the iPhone?

When you touch the screen in the browser, you're indicating that you want to scroll and the browser doesn't animate or load while scrolling.

Add this before your closing </body> tag in your .html to prevent scrolling:
<script type="text/javascript">
	document.body.addEventListener('touchmove', function(e) { 
		e.preventDefault(); // prevents touch-scrolling
		window.scrollTo(0,1); // scrolls to the top again (optional)
	}, false);
</script>

1 decade ago by noar

unfortunately, I'm testing on android :p. The code can not work on android 2.3 default browser.

1 decade ago by Arantor

Did you try the code anyway? The Android browser is supposed to support the touch event set.
Page 1 of 1
« first « previous next › last »