Peep hole

Look through the hole and see what's behind

Source Code for this Sketch

let buffer = ""

function setup() {
	createCanvas(400, 400, P2D, canvas)
	chrisDefaults()
	textAlign(CENTER)

	buffer = ("the end is never the end ".repeat(50) + "\n").repeat(60)
}

function draw() {
	background(240, 100, 30)

	fill(220, 100, 50)
	text(buffer, 0, 0)

	let g = createGraphics(width, height)
	g.colorMode(HSL)
	g.background(50, 100, 50)
	g.erase()
	g.circle(mouseX, mouseY, 100)
	image(g, 0, 0)
}

You may use all or part of the p5 code seen on this page for your own creations, without restriction. Attribution is appreciated but not required.

This sketch also includes the following sources: p5common.js . Sources are available under their respective licenses.

See all p5.js sketches