Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //canvas.js
- var p5 = require('p5')
- module.exports = new p5(function () {
- this.setup = function setup () {
- this.createCanvas(700, 400)
- this.background(205)
- this.loadImage('/uploads/uploaded_image', function (img) {
- image(img, 0, 0)
- })
- this.updatePixels()
- }
- this.clearCanvas = function redraw () {
- this.background('black')
- }
- button(type='button', id='clear').
- Click to clear
- var canvas = require('./canvas.js')
- document.getElementById('clear').onclick = function () {
- canvas.clearCanvas()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement