xxxxxxxxxx
21
function drawBox(x, y, w, h, angle){
push()
rectMode(CENTER)
angleMode(DEGREES)
translate(x+w/2, y+h/2)
rotate(angle)
rect(0, 0, w, h)
pop()
}
function setup() {
createCanvas(512, 256); // set the size of the canvas
background(255) // fill the canvas with white pixels
noStroke()
fill(210)
rect(50, 100, 150, 50)
fill(120)
drawBox(50, 100, 150, 50, -45)
}