|
Re: fade out surfaces: msg#00193python.pygame
On Fri, 2005-09-23 at 12:26 +1000, Luke Miller wrote: > s.alpha -= 5 #or sometimes s.alpha += 5 > multiply_alpha(s.image, s.alpha) > draw(s.image) You are right about fading the alpha in. You'll need to keep a copy of the original alpha and go back that each step you fade in. The integer multiplication loses precision fast, so once you fade the alpha down, it can't really come back up. You are using the wrong type of arguments for multiple_alpha. It takes an integer between 0 and 255. Think of this as multiplying between 0-1. multiple_alpha(image, 128) will half the values in the per pixel alphas. Passing 255 will have no effect, because it is like multiplying by 1. Passing 0 will set all the alpha pixels to 0. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: OpenGL? problems in Linux with pyweek games.: 00193, Mike C. Fletcher |
|---|---|
| Next by Date: | Repository for python developers: 00193, Mikhail Kashkin |
| Previous by Thread: | Re: fade out surfacesi: 00193, Luke Miller |
| Next by Thread: | lists of tuples: 00193, Luke Miller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |