Reputation: 12249
Does anyone know how to do the following things sequentially on an HTML5 canvas (using javascript).
The reason I find this so hard to do, is because there is no way to create a pause in a script. Any help would be greatly appreciated!
Upvotes: 4
Views: 3947
Reputation: 324640
function flashyText() {
var count = 10,
timer = setInterval(function() {
count--;
if( count%2 == 1) {
// draw the text
}
else {
// don't draw it (ie. clear it off)
}
if( count == 0) clearInterval(timer);
},1000);
}
Something like that.
Upvotes: 7