Last active
June 24, 2020 23:25
-
-
Save Chappie74/73115dc181e85fdeb5b8215e50c4bd71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data() { | |
return { | |
canvas: { | |
height: 500, | |
width: 600, | |
background_colour: "#2b2a29", | |
secondary: null | |
} | |
} | |
}, | |
methods: { | |
setup(sk) { | |
sk.createCanvas(this.canvas.width, this.canvas.height) | |
this.canvas.secondary = sk.createGraphics( | |
this.canvas.width, this.canvas.height | |
) | |
// this.canvas.secondary.clear() | |
sk.background(this.canvas.background_colour); | |
}, | |
draw(sk) { | |
sk.background(this.canvas.background_colour); | |
sk.image(this.canvas.secondary, 0, 0) | |
sk.noStroke() | |
sk.fill(this.getToolColour) | |
sk.circle(sk.mouseX, sk.mouseY, this.getToolSize) | |
}, | |
paint_on_sketch(sk) { | |
this.canvas.secondary.stroke(this.getToolColour) | |
this.canvas.secondary.strokeWeight(this.getToolSize) | |
this.canvas.secondary.line(sk.mouseX, sk.mouseY, sk.pmouseX, sk.pmouseY); | |
return false; | |
}, | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment