X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/8efd1374d9e4265c1bd891018e6fd3465eb9e0aa..fa5bf40bfe796d33480a09d9e6400502552d66f7:/src/kinect/pygamedisplay.py?ds=inline diff --git a/src/kinect/pygamedisplay.py b/src/kinect/pygamedisplay.py index 82621ea..fbf0b77 100755 --- a/src/kinect/pygamedisplay.py +++ b/src/kinect/pygamedisplay.py @@ -38,6 +38,24 @@ class RGB : return self.context.wait_one_update_all(self.imgGene) +class RGBSprite(pygame.sprite.DirtySprite, RGB) : + + def __init__(self, alpha=255) : + pygame.sprite.DirtySprite.__init__(self) + self.dirty = 2 # toujours dirty ! + RGB.__init__(self) + + self.image = pygame.Surface((640, 480)) + self._regular = pygame.Surface((640, 480)) + self.image.set_alpha(alpha) + self.rect = pygame.Rect((0, 0), (0, 0)) + + def update(self) : + RGB.update(self) + img = self.capture() + self._regular.blit(img, (0, 0)) + self.image.blit(pygame.transform.flip(self._regular, True, False), (0, 0)) + def main() : pygame.init()