1 parent 2dfe385 commit 9453b6bCopy full SHA for 9453b6b
1 file changed
main.js
@@ -1,6 +1,9 @@
1
+let appWidth,appHeight; //variable to maintain the size of the app
2
function setup()
3
{
- createCanvas(windowWidth,windowHeight);
4
+ appWidth=(windowWidth<1280)?1280:windowWidth; //minimum width of the app should be 1280 pixels and max should be the windowWidth
5
+ appHeight=(windowHeight<720)?720:windowHeight; //minimum height of the app should be 720 pixels and max should be the windowHeight
6
+ createCanvas(appWidth,appHeight);
7
}
8
9
function draw()
@@ -13,5 +16,7 @@ function draw()
13
16
14
17
function windowResized()
15
18
- resizeCanvas(windowWidth, windowHeight);
19
+ appWidth=(windowWidth<1280)?1280:windowWidth;
20
+ appHeight=(windowHeight<720)?720:windowHeight;
21
+ resizeCanvas(appWidth, appHeight);
22
0 commit comments