Making a shared drawing whiteboard with Canvas and WebSockets

Suppose we want a shared sketchpad. Anyone can draw something on the sketchpad and all others can view it. We learned how messages are communicated between clients and servers. We will go further and send drawing data.

Building a local drawing sketchpad

Before we deal with data sending and server handling, let's focus on making a drawing whiteboard. We will use the Canvas to build a local drawing sketchpad.

Get HTML5 Game Development by Example : Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.