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 overlay
  • IMG_URL: string (between quotes), image to go behind the overlay
  • CANVAS_WIDTH: number, horizontal size of the canvas
  • CANVAS_HEIGHT: number, vertical size of the canvas
  • BRUSH_RADIUS: number, how big the eraser is

results matching ""

    No results matching ""