Description Usage Arguments See Also Examples
Draw a Rectangle
1 |
sketch |
A p5 sketch. |
x |
The x coordinate for the |
y |
The y coordinate for the |
w |
The width of the rectangle. |
h |
The height of the rectangle. |
Other Shape 2D Primitives: arc
,
ellipse
, line
,
point
, quad
,
triangle
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
p5() %>%
rect(10, 10, 30, 40)
library(dplyr)
data_frame(x = c(10, 30, 10, 30),
y = c(10, 10, 30, 30),
w = rep(10, 4),
h = rep(10, 4)) %>%
p5() %>%
rect()
data_frame(A = c(10, 40),
B = c(10, 10),
Width = c(20, 10),
Height = c(30, 40)) %>%
p5() %>%
rect(~A, ~B, ~Width, ~Height)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.