Abstract canvas width/height into variables
This commit is contained in:
parent
4a2cc7ccb1
commit
dfb398a8f8
@ -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…
Reference in New Issue
Block a user