touch and hold

touch and hold
0.0 0


does cocos2d html5 support touch and hold event?

i have a sprite that on click and hold, i would like to continuously perform the same callback. Simple e.g. includes clicking on the “UP” button and while depressed - or at its’ selected state - calls a function such as increaseByOne() so that a label will be modified incrementally with an increasing count.

do advise :slight_smile:


Theoretically, I would say since hold happens after a TouchBegin and before a TouchEnd, a local variable isTouched should be set to true on a TouchBegin and false on a TouchEnd. Then during update schedule, check the isTouched variable and perform the function call.