From 1fff6840fbea7090fac248593e4e0cf07426e501 Mon Sep 17 00:00:00 2001 From: megamichi Date: Sat, 20 Jan 2024 20:48:24 +0100 Subject: [PATCH] klappt ned :( --- main.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 0244573..cca79ae 100755 --- a/main.py +++ b/main.py @@ -64,18 +64,21 @@ class DVD(): scaledy = self.size[1]*self.scale self.scalesize = (scaledx,scaledy) self.rendered_dvd = pygame.surface.Surface(self.scalesize, flags=pygame.SRCALPHA) - - self.rendered_dvd.fill(self.color) self.rendered_dvd = pygame.transform.scale(self.dvd,self.scalesize)#(self.scalesize[0],self.scalesize[1]+10)) - #pygame.transform.threshold(self.advd, self.advd, (0, 0, 0), (0, 0, 0,128), self.color, inverse_set=False) + self.rendered_dvd2 = pygame.surface.Surface(self.scalesize, flags=pygame.SRCALPHA) + self.rendered_dvd2.fill(self.color) + + pygame.transform.threshold(self.rendered_dvd, self.rendered_dvd2, (0, 0, 0), (255, 0, 0, 128), self.color, inverse_set=False) + + #screen.blit(self.rendered_dvd2,self.pos) screen.blit(self.rendered_dvd,self.pos) def render(self): self.get_dvd() - pygame.draw.rect(screen,self.color,(self.pos[0],self.pos[1],self.scalesize[0],self.scalesize[1])) - screen.blit(self.rendered_dvd,self.pos) + #pygame.draw.rect(screen,self.color,(self.pos[0],self.pos[1],self.scalesize[0],self.scalesize[1])) + #screen.blit(self.rendered_dvd,self.pos) dvds = [] dvds.append(DVD(1,1))#ri(1,10)))