October second post
- Chelsea Yang
- Nov 4, 2020
- 1 min read
This week I worked on learning how to code shapes in certain coordinates, incorporating text, as well as creating different background colors.
Through using the p5.js community learning page and the introductory book, i learnt to create shapes of different centers, width and height. I tried to incorporate colors and dimensions to shapes, and learnt how to locate shapes on a canvas from the mouse. By changing the center coordinate values to mouse X and mouse Y, ellipses could be drawn at the position of the mouse. When the mouse is clicked, the ellipse could turn into a different color.
I learnt to create a rectangle with the rect() block, stating the center coordinate from the left, center coordinate from the right, width and height in the parenthesis.
I also learnt to create texts through the text() block, including the text in a single quote and it’s coordinates in the parenthesis.
Comments