Drawing rectangles and squares


show more Drawing rectangles and squares provides you with in-depth training on Developer. Taught by Barton Poulson as part of the Interactive Data Visualization with Processing show less
please wait ...

Drawing rectangles and squares

The next primitive shape that we're going to work with in Processing is squares or more appropriately, rectangles, because just as with circles, Processing doesn't have a built-in function for squares, when it is as rectangles where you draw the same width and height, but let's take a look at this one, this function is pretty easy to deal with. The first thing I'm going to do, I'm going to create a comment with my file name then I'll set the size of the window, turn on anti-aliasing then I'll put a background, it'll be a sort of a light yellowish color.

I'm going to use the hex codes again and when I save that you can see there's our background. Now I'm going to start drawing some squares and the way I do this is with rect for rectangle and it draws it from the top left corner. So what I need to do is I need to set the coordinates for the top left, in this case I'll use 60 pixels over, 60 pixels down and then you specify the width and the...

Drawing rectangles and squares
Video duration: 4m 58s 7h 43m Beginner

Viewers:

Drawing rectangles and squares provides you with in-depth training on Developer. Taught by Barton Poulson as part of the Interactive Data Visualization with Processing

Subjects:
Developer IT
Software:
Processing
Author:
please wait ...