0
Help me to improve my code
now this code is only work when we are tapping or moving our finger on screen but i also want to use this effect when we are holding on screen https://code.sololearn.com/W5A1selLbys2/?ref=app
2 Respostas
+ 1
You have to keep pushing the points continuosly though no touch event is sent.
A way is start an interval on touchstart event that push last point every x milliseconds. Es:
function starTimer(){
window.setInterval(function(){
genrate();
}, 200);
}
window.addEventListener("touchstart", function(event){
starTimer()
});
Its a very simple code that dont handle touch ending, but is simple to understand
0
But it's working after we remove our finger from screen I want to stop animation when we remove our fingers