Skip to content

Instantly share code, notes, and snippets.

@simsaens
Created January 25, 2019 11:09
Show Gist options
  • Save simsaens/4fbf1eadb1793007c4317d504e537347 to your computer and use it in GitHub Desktop.
Save simsaens/4fbf1eadb1793007c4317d504e537347 to your computer and use it in GitHub Desktop.
Render one frame in setup
function setup()
background(0)
-- Render once into an image the size of the screen
img = image(WIDTH,HEIGHT)
setContext(img)
stroke(255)
strokeWidth(5)
fill(227, 106, 106, 255)
ellipse(WIDTH/2, HEIGHT/2, 500)
setContext()
end
function draw()
-- Just draw the image we rendered into in setup()
spriteMode(CORNER)
sprite(img, 0, 0)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment