[pygame] Masking Test: Simulated Lighting (Follow-Up)

2007-01-21 Thread Kris Schnee
I played with the idea more and was able to make a moving light source by, each frame, making a solid black mask, using pygame.draw.circle to draw a transparent circle on it, then blitting the holey mask onto the screen. This turned everything black except where the light had been placed, and

Re: [pygame] Masking Test: Simulated Lighting (Follow-Up)

2007-01-21 Thread Kris Schnee
Kamilche wrote: Try the following code. It uses a gradient light. I'm trying to figure out how your example (much better than mine) works. It looks like the key is the last line of this function: def RefreshNight(night, alpha, light, x, y): a = NIGHTCOLOR[3] alpha.fill([a, a, a])

Re: [pygame] Masking Test: Simulated Lighting (Follow-Up)

2007-01-21 Thread Kamilche
Kris Schnee wrote: Kamilche wrote: Try the following code. It uses a gradient light. I'm trying to figure out how your example (much better than mine) works. It looks like the key is the last line of this function: def RefreshNight(night, alpha, light, x, y): a = NIGHTCOLOR[3]

Re: [pygame] Masking Test: Simulated Lighting (Follow-Up)

2007-01-21 Thread Lenard Lindstrom
Kris Schnee wrote: Kamilche wrote: Try the following code. It uses a gradient light. I'm trying to figure out how your example (much better than mine) works. It looks like the key is the last line of this function: def RefreshNight(night, alpha, light, x, y): a = NIGHTCOLOR[3]