rect: Draw a Rectangle

Description Usage Arguments See Also Examples

Description

Draw a Rectangle

Usage

1
rect(sketch, x = NULL, y = NULL, w = NULL, h = NULL)

Arguments

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.

See Also

Other Shape 2D Primitives: arc, ellipse, line, point, quad, triangle

Examples

 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)

seankross/p5 documentation built on May 30, 2019, 8:17 a.m.