Scratch Reveal
Click here for the starter code. Make sure to fork the project to create your own version!
This example shows how to make an image covered up by an overlay, that can then be erased by clicking and dragging! (or box) in 3D! The code in the script.js is a little complicated, but the variables at the top are a good way to manipulate the project:
COVER_COLOR: string (between quotes), the color of the overlayIMG_URL: string (between quotes), image to go behind the overlayCANVAS_WIDTH: number, horizontal size of the canvasCANVAS_HEIGHT: number, vertical size of the canvasBRUSH_RADIUS: number, how big the eraser is