 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
JetSpike
Joined: 19 Sep 2005 Posts: 8
|
Posted: Sat Mar 18, 2006 1:22 pm Post subject: Fade Image (screen) to black |
|
|
I have created an image like this:
imgAlpha = Image.createEmpty(480,272)
clrAlpha = Color.new(0,0,0,150)
imgAlpha:fillRect(0,0,479,271,clrAlpha)
So now I have a black rectangle the size of the screen with an alpha value of 150.
I have another image:
imgToFade = Image.createEmpty(480,272)
imgToFade:clear(clrBlack)
I then draw some graphics to imgToFade.
Now what want to do is blit imgAlpha on to imgToFade, once every loop, so the effect will be imgToFade will go completely black if I don't draw anything new. However, when I try to blit imgAlpha on to imgToFade, it doesn't blend properly. If I set an alpha value of 255, then it works, but I want to use a lower value so if fades gradually.
I know the imgAlpha works correctly because if I do this:
screen:clear(clrBlack)
screen:blit(0,0,imgToFade,true)
screen:blit(0,0,imgAlpha,true)
Then the graphics on imgToFade are blended appropriately. But I want to have it apply the blend on to imgToFade itself so eventually it goes to black.
Any ideas why this isn't happening the way I expect it to? |
|
| Back to top |
|
 |
fullerlee
Joined: 03 Nov 2005 Posts: 54
|
Posted: Sat Mar 18, 2006 1:38 pm Post subject: |
|
|
| I've found that alpha values of 0 or 255 are the only ones that work correctly. |
|
| Back to top |
|
 |
JetSpike
Joined: 19 Sep 2005 Posts: 8
|
Posted: Sat Mar 18, 2006 2:38 pm Post subject: |
|
|
| Yeah, it's weird, only two values work when blitting to an image, but when I blit to the screen directly, I can use any value I want. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|