QClean and lock / unlock button

Hello, how do I clean the screen (which is drawn) with a button?
Also would like to know how I can do through a button, to lock the painting and through the same button unlock...
I'm sorry for my english

Sample Code

AAnswer to: Clean and lock / unlock button


Hey, that coe just uses another canvas as a texture. To clear the canvas, you could just reset its width, like so:

canvas.width = canvas.width;

and then mark the texture for update:

texture.needsUpdate = true;

edited: ok, width = width does clear it to black, but since it was pale blue originally you don't want that; I have added the fork that does what you really want.

Post a question

You can post JavaScript, HTML, CSS related questions with attached reference to actual codes and get the answers likewise.

Ask a question

  • 1. Click the ‘Post a question’ above

  • 2. Enter question details, reference code, and click ‘Add question’ button

  • 3. Question will be paired with the code on display

Add an answer

  • 1. Choose a question

  • 2. Enter answer details, attach the reference code and click ‘add answer’ button

  • 3. Your answer will accompanied with attached code