top of page

Using Variables to Design

Create a canvas that is 800px wide by 600px high. Draw a rectangle in the middle of the screen that is half the width and half the height of the canvas without using any hard-coded numbers in the rect( ) function.

See my sketch here

This sketch uses the default rect() function that asks for the top left coordinate as the starting point for the rectangle. You can also change the mode of the rect function so that it starts in the center of the canvas.

8 views0 comments

Recent Posts

See All
bottom of page