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] alph

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] alph

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: But a problem appeared in trying to make the process more efficient, by drawing a lightmask on its own, once, then each blitting it onto the black mask, then blitting the black mask onto the screen. Doing it that way would be better for complex, gradient lights such as the bi

[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