Abstract canvas width/height into variables

This commit is contained in:
Luke Murphy 2019-12-18 22:45:12 +07:00
parent 4a2cc7ccb1
commit dfb398a8f8
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -8,6 +8,8 @@
//
var archiveUrl = serverUrl + "/add-to-archive/";
var canvasHeight = 500;
var canvasWidth = 500;
var microphone;
var newSoundJustRecorded = false;
var playButton;
@ -120,7 +122,7 @@ class GeneratedShape {
/**
* Show the shape on the canvas.
**/
ellipse(random(600), random(600), 10, 10); // TODO: experimenting for now ...
ellipse(random(canvasWidth), random(canvasHeight), 10, 10); // TODO: experimenting for now ...
this.displayed = true;
}
}
@ -136,7 +138,7 @@ function setup() {
/**
* The p5.js initial setup function.
**/
createCanvas(600, 600); // TODO: experimenting for now ...
createCanvas(canvasWidth, canvasHeight); // TODO: experimenting for now ...
setupRecording();
}