How to use multiple canvas contexts?

Danny Fox picture Danny Fox · Dec 11, 2011 · Viewed 11k times · Source

I would like to use experimental-webgl, and the 2d canvas context also. After I've drawn the 3d objects, I want to draw some 2d objects over it.

How should I do it?

Answer

bennedich picture bennedich · Dec 11, 2011

You need a separate canvas. You can put the other canvas over the first one, this is not considered bad practice.