Created
June 21, 2011 11:44
-
-
Save anonymous/1037688 to your computer and use it in GitHub Desktop.
Light points
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sw and sh are width and height of canvas | |
// lightpoints are like this: lightpoints[i] = [x, y] | |
// the grid is 32 pixels | |
// How do I make them not intersect? | |
gc.save(); | |
gc.globalAlpha = 0.25; | |
gc.fillStyle = "black"; | |
gc.shadowColor = "black"; | |
gc.shadowBlur = 5; | |
gc.beginPath(); | |
gc.rect(0, 0, sw, sh); | |
for(i=0; i < lightpoints.length; i+=1) { | |
gc.arc(lightpoints[i][0]+16, lightpoints[i][1]+16, 96, Math.PI*2, 0, true); | |
} | |
gc.closePath(); | |
gc.fill(); | |
gc.restore(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment