[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Fade to black question...
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Fade to black question...
- From: "Ty ..." <ty.sqlite@xxxxxxxxx>
- Date: Tue, 10 Mar 2009 09:32:02 -0600
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Tue, 10 Mar 2009 11:32:04 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=ezxSQ46FMVEcHJm2oJ+6YK8XOELMAReOSBgJHPR5Y+w=; b=EhSEcstfvB0IXyjNLaCHbVFNv6G+mUn3mE0+UZ0Uen0TWQyIzNQOEcSap/1s8b6/nM /YxRBIP19dvYi2XAeGPXVYdQrT2F2r8sWVktii4PCpz8c6ex3CinOpBV1e7kAqRvDX0e 5hB5mXshMVAi/n9gHuOEtTFMj5WcbO4VCKKC8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=Ea9T42MkxN9+zYUZWh1sHstqS8Hf5XSGjucI68GEBi2BQNuL3XvT70ry0ODVuDnejo k1xw7fVQuUQ+bvPgiD+1jnyTC3ukQ3H2l50q38ya4ah/2gnTHhGXmhEDIKa5/JZqSUvU Gb4vjT/z21pcKPiR5XAr6HzxSK+Lw8IBx0poU=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I'm trying to get a fade to black working, to that end I've written a
simple program just to try it out... the (partial) code looks like
this:
self.screen.fill(white)
self.screen.blit(self.image, self.size, self.size)
print self.screen.get_at((4,4));
self.screen.fill((2,2,2), None, BLEND_SUB)
print self.screen.get_at((4,4));
self.screen.fill((2,2,2), None, BLEND_SUB)
print self.screen.get_at((4,4));
self.screen.fill((2,2,2), None, BLEND_SUB)
print self.screen.get_at((4,4));
sys.exit()
And the output...
(46, 46, 44, 255)
(44, 255, 42, 255)
(42, 255, 40, 255)
(40, 255, 38, 255)
To me, it looks like it's working for the R and B components, but for
some reason G immediately goes to 255 and never changes. Is there
something I'm doing wrong here?
Also, one other question... how would I get it to stop at (0,0,0)
rather than wrap around? If I continue the loop for a long time, I
get output that looks like this...
(8, 255, 6, 255)
(6, 255, 4, 255)
(4, 255, 2, 255)
(2, 255, 0, 255)
(0, 255, 254, 255)
(254, 255, 252, 255)
(252, 255, 250, 255)
(250, 255, 248, 255)
Which means I've going to have to check that each time and make sure
no wrap around has occured? I might as well loop through every pixel
in the image and do this kind of operation myself :P.
Thanks!
~Ty