top of page

Changing Canvas Size

Revisit the code example from Question 1 of Week 1’s exercises. Rewrite the code such that the rectangles are responsive if the canvas dimensions change.


See the sketch here


First step is to move the rectangle function to the 'draw' space.

Then, use math and the built in function windowHeight and windowWidth.

I also subtracted a value from the windowHeight so you can see the bottom border of the rectangle




6 views0 comments

Recent Posts

See All
bottom of page