Browse Source

Abstract canvas width/height into variables

main
Luke Murphy 5 years ago
parent
commit
dfb398a8f8
No known key found for this signature in database GPG Key ID: 5E2EF5A63E3718CC
  1. 6
      vocoder/static/vocoder.js

6
vocoder/static/vocoder.js

@ -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();
}

Loading…
Cancel
Save