Wasin Thonkaew ccTouchesMoved() event can't keep up user's touches.
Posts 227
Added by Wasin Thonkaew 10 months ago

I tested a game incorporating ccTouchesMoved() event in the code and found out that the event isn't called fast enough to keep up the changing touch-position from users.
My test is that I will move a sprite according to the current position of the touch from user.
Testing on cocos2d-x is fine, it can keep up but not for web. It seems I need to wait for user to stop the touching then sprite will change its position. I do think it's a limit on browser to receive such intensive event.

Any idea on what might be the problem? Thanks ahead!

Hao Wu RE: ccTouchesMoved() event can't keep up user's touches.
Posts 158
Location Xiamen, Sydney
Added by Hao Wu 10 months ago

Because the way browser handles touch/mouse event, a new event object is created when an event is triggered, unlike native cocos2d-x. this is a limitation in the browser side, so you need to assign the sprite position for every event.

what you saw was your touchended event firing and setting your sprite to that position only.

please have a look at touchtest in our test samples

Wasin Thonkaew RE: ccTouchesMoved() event can't keep up user's touches.
Posts 227
Added by Wasin Thonkaew 10 months ago

Thanks Hao Wu !


(1-2/2)