xxxxxxxxxx
36
let font
let fontSize = 100
let word = "YUM"
let img
let width = 400
let height = 400
let rowSize = 5
function preload() {
font = loadFont('./Raleway-Black.ttf')
img = loadImage('yum.png')
}
function setup() {
createCanvas(width, height)
img.resize(width, height)
noLoop()
}
function draw() {
background(0)
// Copy rows from the image to the canvas.
for (let y = 0; y < height; y += rowSize) {
let sx = 0 + int(random(10)) - 5
let sy = y
let dx = 0
let dy = y
copy(img,
sx, sy, width, rowSize,
dx, dy, width, rowSize)
}
}