Skip to content

Instantly share code, notes, and snippets.

Created January 8, 2017 20:41
What would you like to do?
function love.load()
screenWidth =
screenHeight =
canvas =, screenHeight)
function love.draw(dt)
-- draw to canvas
local w = screenWidth / 2'alpha')
-- draw cyan rect on the left, 255, 255)'fill', 0, 0, w, screenHeight)
-- draw yellow rect on the right, 255, 0)'fill', w, 0, w, screenHeight)
-- blit canvas to screen"alpha", "premultiplied")
-- after drawing canvas to screen, left rect is green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment