Archive for September, 2011

How to clear the iOS and Mobile Webkit HTML5 Canvas

Took me forever to find this, but hopefully you found this post faster:
You can either use “context.clearRect(0, 0, canvas.width, canvas.height);” Which I found only worked sometimes, and best in desktop version of the browser.
What I did was the width trick (setting the canvas width to itself clears EVERYTHING), and since I had also drawn lines [...]

Canvas, HTML5, How To