Skip to content

Instantly share code, notes, and snippets.

@Chappie74
Last active June 24, 2020 23:25
Show Gist options
  • Save Chappie74/73115dc181e85fdeb5b8215e50c4bd71 to your computer and use it in GitHub Desktop.
Save Chappie74/73115dc181e85fdeb5b8215e50c4bd71 to your computer and use it in GitHub Desktop.
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